| java.lang.Object org.apache.tools.ant.util.ReflectWrapper
ReflectWrapper | public class ReflectWrapper (Code) | | Utility class to handle reflection on java objects.
The class is a holder class for an object and
uses java reflection to call methods on the objects.
If things go wrong, BuildExceptions are thrown.
|
Method Summary | |
public Object | getObject() | public Object | invoke(String methodName) Call a method on the object with no parameters. | public Object | invoke(String methodName, Class argType, Object arg) Call a method on the object with one argument.
Parameters: methodName - the name of the method to call Parameters: argType - the type of argument. Parameters: arg - the value of the argument. | public Object | invoke(String methodName, Class argType1, Object arg1, Class argType2, Object arg2) Call a method on the object with one argument.
Parameters: methodName - the name of the method to call Parameters: argType1 - the type of the first argument. Parameters: arg1 - the value of the first argument. Parameters: argType2 - the type of the second argument. Parameters: arg2 - the value of the second argument. |
ReflectWrapper | public ReflectWrapper(ClassLoader loader, String name)(Code) | | Construct a wrapped object using the no arg constructor.
Parameters: loader - the classloader to use to construct the class. Parameters: name - the classname of the object to construct. |
ReflectWrapper | public ReflectWrapper(Object obj)(Code) | | Constructor using a passed in object.
Parameters: obj - the object to wrap. |
getObject | public Object getObject()(Code) | | the wrapped object. |
invoke | public Object invoke(String methodName)(Code) | | Call a method on the object with no parameters.
Parameters: methodName - the name of the method to call the object returned by the method |
invoke | public Object invoke(String methodName, Class argType, Object arg)(Code) | | Call a method on the object with one argument.
Parameters: methodName - the name of the method to call Parameters: argType - the type of argument. Parameters: arg - the value of the argument. the object returned by the method |
invoke | public Object invoke(String methodName, Class argType1, Object arg1, Class argType2, Object arg2)(Code) | | Call a method on the object with one argument.
Parameters: methodName - the name of the method to call Parameters: argType1 - the type of the first argument. Parameters: arg1 - the value of the first argument. Parameters: argType2 - the type of the second argument. Parameters: arg2 - the value of the second argument. the object returned by the method |
|
|