|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sas.edir.util.ReflectOp
The ReflectOp class contains static methods that are useful for doing reflection.
Constructor Summary | |
ReflectOp()
|
Method Summary | |
static java.lang.reflect.Constructor |
getConstructor(java.lang.Class from,
java.lang.Object[] params)
Returns a constructor that matches the specified signature. |
static java.lang.reflect.Field |
getField(java.lang.Class from,
java.lang.String fieldName)
|
static java.lang.Object |
getFieldValue(java.lang.Class from,
java.lang.String fieldName)
|
static java.lang.reflect.Method |
getMethod(java.lang.Class from,
java.lang.String methodName,
java.lang.Object methodParameter)
Returns a method that matches the specified signature. |
static java.lang.reflect.Method |
getMethod(java.lang.Class from,
java.lang.String methodName,
java.lang.Object[] params)
Returns a method that matches the specified signature. |
static java.lang.reflect.Method |
getMethod(java.lang.Class from,
java.lang.String methodName,
java.util.Vector methodParameters)
Returns a method that matches the specified signature. |
static java.lang.String |
methodString(java.lang.Object obj,
java.lang.Object methodName,
java.lang.Object arg)
Returns a string representation of the method. |
static java.lang.String |
methodString(java.lang.Object obj,
java.lang.Object methodName,
java.lang.Object[] args)
Returns a string representation of the method. |
static java.lang.String |
methodString(java.lang.Object obj,
java.lang.Object methodName,
java.util.Vector args)
Returns a string representation of the method. |
static java.lang.Object |
newObject(java.lang.Class objectClass)
Instantiates and returns an object. |
static java.lang.Object |
newObject(java.lang.Class objectClass,
java.lang.Object ctorArg)
Instantiates and returns an object. |
static java.lang.Object |
newObject(java.lang.Class objectClass,
java.lang.Object[] ctorArgs)
Instantiates and returns an object. |
static java.lang.Object |
newObject(java.lang.String[] propArray)
Instantiates and returns an object. |
static java.lang.Object |
newObject(java.lang.String[] propArray,
java.lang.Object ctorArg)
Instantiates and returns an object. |
static java.lang.Object |
newObject(java.lang.String[] propArray,
java.lang.Object[] ctorArgs)
Instantiates and returns an object. |
static java.lang.Object |
runMethod(java.lang.Object from,
java.lang.String methodName)
Runs the specified method and returns the value returned by that method. |
static java.lang.Object |
runMethod(java.lang.Object from,
java.lang.String methodName,
java.lang.Object methodParameter)
Runs the specified method and returns the value returned by that method. |
static java.lang.Object |
runMethod(java.lang.Object from,
java.lang.String methodName,
java.lang.Object[] params)
Runs the specified method and returns the value returned by that method. |
static java.lang.Object |
runMethod(java.lang.Object from,
java.lang.String methodName,
java.util.Vector methodParameters)
Runs the specified method and returns the value returned by that method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReflectOp()
Method Detail |
public static final java.lang.Object newObject(java.lang.Class objectClass) throws ReflectionException
objectClass
- The objects class.ReflectionException
- Thrown on object instantiation failure.public static final java.lang.Object newObject(java.lang.Class objectClass, java.lang.Object ctorArg) throws ReflectionException
objectClass
- The objects class.ctorArg
- An argument to pass to the constructor.ReflectionException
- Thrown on object instantiation failure.public static final java.lang.Object newObject(java.lang.Class objectClass, java.lang.Object[] ctorArgs) throws ReflectionException
objectClass
- The objects class.ctorArgs
- The arguments to pass to the constructor.ReflectionException
- Thrown on object instantiation failure.public static final java.lang.Object newObject(java.lang.String[] propArray) throws ReflectionException
propArray
- The properties array.ReflectionException
- Thrown on object instantiation failure.public static final java.lang.Object newObject(java.lang.String[] propArray, java.lang.Object ctorArg) throws ReflectionException
propArray
- The properties array.ctorArg
- An argument to pass to the constructor.ReflectionException
- Thrown on object instantiation failure.public static final java.lang.Object newObject(java.lang.String[] propArray, java.lang.Object[] ctorArgs) throws ReflectionException
propArray
- The properties array.ctorArgs
- The arguments to pass to the constructor.ReflectionException
- Thrown on object instantiation failure.public static final java.lang.reflect.Constructor getConstructor(java.lang.Class from, java.lang.Object[] params) throws java.lang.ClassNotFoundException
from
- The class from which we are getting the constructor.params
- The constructor parameters.java.lang.ClassNotFoundException
- If the class can not be found.public static final java.lang.Object getFieldValue(java.lang.Class from, java.lang.String fieldName) throws ReflectionException
public static final java.lang.reflect.Field getField(java.lang.Class from, java.lang.String fieldName) throws java.lang.ClassNotFoundException
public static final java.lang.reflect.Method getMethod(java.lang.Class from, java.lang.String methodName, java.lang.Object methodParameter) throws java.lang.ClassNotFoundException
from
- The class from which we are getting the method.methodName
- The method name.methodParameter
- The method parameter.java.lang.ClassNotFoundException
- If the class can not be found.public static final java.lang.reflect.Method getMethod(java.lang.Class from, java.lang.String methodName, java.util.Vector methodParameters) throws java.lang.ClassNotFoundException
from
- The class from which we are getting the method.methodName
- The method name.methodParameters
- The method parameters.java.lang.ClassNotFoundException
- If the class can not be found.public static final java.lang.reflect.Method getMethod(java.lang.Class from, java.lang.String methodName, java.lang.Object[] params) throws java.lang.ClassNotFoundException
from
- The class from which we are getting the method.methodName
- The method name.params
- The method parameters.java.lang.ClassNotFoundException
- If the class can not be found.public static final java.lang.Object runMethod(java.lang.Object from, java.lang.String methodName) throws ReflectionException
from
- The class from which we are getting the method.methodName
- The method name.ReflectionException
- Thrown if an exception occurs running the
method.public static final java.lang.Object runMethod(java.lang.Object from, java.lang.String methodName, java.lang.Object methodParameter) throws ReflectionException
from
- The class from which we are getting the method.methodName
- The method name.methodParameter
- The method parameter.ReflectionException
- Thrown if an exception occurs running the
method.public static final java.lang.Object runMethod(java.lang.Object from, java.lang.String methodName, java.util.Vector methodParameters) throws ReflectionException
from
- The class from which we are getting the method.methodName
- The method name.methodParameters
- The method parameters.ReflectionException
- Thrown if an exception occurs running the
method.public static final java.lang.Object runMethod(java.lang.Object from, java.lang.String methodName, java.lang.Object[] params) throws ReflectionException
from
- The class from which we are getting the method.methodName
- The method name.methodParameters
- The method parameters.ReflectionException
- Thrown if an exception occurs running the
method.public static final java.lang.String methodString(java.lang.Object obj, java.lang.Object methodName, java.lang.Object arg)
obj
- The object containing the method.methodName
- The method name.arg
- The method argument.public static final java.lang.String methodString(java.lang.Object obj, java.lang.Object methodName, java.util.Vector args)
obj
- The object containing the method.methodName
- The method name.args
- The method arguments.public static final java.lang.String methodString(java.lang.Object obj, java.lang.Object methodName, java.lang.Object[] args)
obj
- The object containing the method.methodName
- The method name.args
- The method arguments.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |