net.sourceforge.mflow.reflect
Class ReflectionUtil
java.lang.Object
net.sourceforge.mflow.reflect.ReflectionUtil
- public class ReflectionUtil
- extends java.lang.Object
- Author:
- carrd
Method Summary |
static java.lang.Object |
instantiate(java.lang.Class clazz,
java.util.List sigs)
Attempts to create an instance of a Class given a List of
ParamArgPair s. |
static java.lang.Object |
instantiate(java.lang.String className,
java.util.List sigs)
Attempts to create an instance of a class based on its name and a
List of ParamArgPair s. |
static java.lang.Object |
invokeMethod(java.lang.Object obj,
java.lang.String methodName,
java.util.List sigs)
Attempts to invoke a named method on an arbitrary object, given a
List of ParamArgPair s. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionUtil
public ReflectionUtil()
instantiate
public static java.lang.Object instantiate(java.lang.String className,
java.util.List sigs)
throws ReflectionException
- Attempts to create an instance of a class based on its name and a
List
of ParamArgPair
s.
- Parameters:
className
- the name of a classsigs
- a list of ParamArgPair
s to try in order
- Returns:
- an instance of the class
- Throws:
ReflectionException
- if an instance could not be obtained
instantiate
public static java.lang.Object instantiate(java.lang.Class clazz,
java.util.List sigs)
throws ReflectionException
- Attempts to create an instance of a
Class
given a List
of
ParamArgPair
s.
- Parameters:
clazz
- a Class
objectsigs
- a list of ParamArgPair
s to try in order
- Returns:
- an instance of the class
- Throws:
ReflectionException
- if an instance could not be obtained
invokeMethod
public static java.lang.Object invokeMethod(java.lang.Object obj,
java.lang.String methodName,
java.util.List sigs)
throws ReflectionException
- Attempts to invoke a named method on an arbitrary object, given a
List
of ParamArgPair
s.
- Parameters:
obj
- the object to invoke the method onmethodName
- the name of the method to invokesigs
- the List
of ParamArgPair
s
- Returns:
- the return value of the method, or null if none
- Throws:
ReflectionException
- if the method cannot be called
Copyright © 2002-2004 MFlow Group. All Rights Reserved.