| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.util.ReflectWrapper
public class ReflectWrapper
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.
| Constructor Summary | |
|---|---|
| ReflectWrapper(java.lang.ClassLoader loader,
               java.lang.String name)Construct a wrapped object using the no arg constructor. | |
| ReflectWrapper(java.lang.Object obj)Constructor using a passed in object. | |
| Method Summary | |
|---|---|
|  java.lang.Object | getObject() | 
|  java.lang.Object | invoke(java.lang.String methodName)Call a method on the object with no parameters. | 
|  java.lang.Object | invoke(java.lang.String methodName,
       java.lang.Class argType,
       java.lang.Object arg)Call a method on the object with one argument. | 
|  java.lang.Object | invoke(java.lang.String methodName,
       java.lang.Class argType1,
       java.lang.Object arg1,
       java.lang.Class argType2,
       java.lang.Object arg2)Call a method on the object with one argument. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ReflectWrapper(java.lang.ClassLoader loader,
                      java.lang.String name)
loader - the classloader to use to construct the class.name - the classname of the object to construct.public ReflectWrapper(java.lang.Object obj)
obj - the object to wrap.| Method Detail | 
|---|
public java.lang.Object getObject()
public java.lang.Object invoke(java.lang.String methodName)
methodName - the name of the method to call
public java.lang.Object invoke(java.lang.String methodName,
                               java.lang.Class argType,
                               java.lang.Object arg)
methodName - the name of the method to callargType - the type of argument.arg - the value of the argument.
public java.lang.Object invoke(java.lang.String methodName,
                               java.lang.Class argType1,
                               java.lang.Object arg1,
                               java.lang.Class argType2,
                               java.lang.Object arg2)
methodName - the name of the method to callargType1 - the type of the first argument.arg1 - the value of the first argument.argType2 - the type of the second argument.arg2 - the value of the second argument.
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||