Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static < desired type T> T | |
public static < desired type T> T | |
public static < desired type T> T | |
public static < desired type T> T | Returns: the object returned by the methodthe object to invoke the method on. obj, String the name of the method to call methodName, Class<?> the type of the first argument. argType1, Object the value of the first argument. arg1, Class<?> the type of the second argument. argType2, Object the value of the second argument. arg2)Call a method on the object with two argument. |
public static < desired type T> T | Returns: the object returned by the methodthe object to invoke the method on. obj, String the name of the method to call methodName)Call a method on the object with no parameters. |
public static < desired type T> T | Returns: class instanceClass<T> ofClass, Class<?>[] Class<?>[] argTypes, Object[] Object[] args)Create an instance of a class using the constructor matching the given arguments. |
public static boolean | Returns: true if the object has the method.the object o, String the method to check for methodName)A method to test if an object responds to a given message (method call) |
public static void | throwBuildException(Exception
the invocation target exception. t)A method to convert an invocationTargetException to a BuildException and throw it. |
public static BuildException | Returns: the converted exception.the invocation target exception. t)A method to convert an invocationTargetException to a BuildException. |
ReflectUtil | back to summary |
---|---|
private ReflectUtil() private constructor |
getField | back to summary |
---|---|
public static <T> T getField(Object obj, String fieldName) throws BuildException Get the value of a field in an object.
|
invoke | back to summary |
---|---|
public static <T> T invoke(Object obj, String methodName) Call a method on the object with no parameters.
|
invoke | back to summary |
---|---|
public static <T> T invoke(Object obj, String methodName, Class<?> argType, Object arg) Call a method on the object with one argument.
|
invoke | back to summary |
---|---|
public static <T> T invoke(Object obj, String methodName, Class<?> argType1, Object arg1, Class<?> argType2, Object arg2) Call a method on the object with two argument.
|
invokeStatic | back to summary |
---|---|
public static <T> T invokeStatic(Object obj, String methodName) Call a method on the object with no parameters. Note Unlike the invoke method above, this calls class or static methods, not instance methods.
|
newInstance | back to summary |
---|---|
public static <T> T newInstance(Class<T> ofClass, Class<?>[] argTypes, Object[] args) Create an instance of a class using the constructor matching the given arguments. |
respondsTo | back to summary |
---|---|
public static boolean respondsTo(Object o, String methodName) throws BuildException A method to test if an object responds to a given message (method call)
|
throwBuildException | back to summary |
---|---|
public static void throwBuildException(Exception t) throws BuildException A method to convert an invocationTargetException to a BuildException and throw it.
|
toBuildException | back to summary |
---|---|
public static BuildException toBuildException(Exception t) A method to convert an invocationTargetException to a BuildException.
|