gnu.jel.reflect
Class Method
java.lang.Object
|
+--gnu.jel.reflect.LocalField
|
+--gnu.jel.reflect.LocalMethod
|
+--gnu.jel.reflect.Method
- public class Method
- extends LocalMethod
Represents a method of already compiled class.
Constructor Summary |
Method(java.lang.reflect.Constructor c)
Constructs a new Method object for a constructor. |
Method(java.lang.reflect.Method m)
Constructs a new Method object. |
Method Summary |
java.lang.Object |
eval(java.lang.Object obj,
java.lang.Object[] params)
Evaluates the member. |
java.lang.Class |
getDeclaringClass()
|
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method
public Method(java.lang.reflect.Method m)
- Constructs a new Method object.
- Parameters:
m
- is corresponding java.lang.reflect.Method object.
Method
public Method(java.lang.reflect.Constructor c)
- Constructs a new Method object for a constructor.
- Parameters:
m
- is corresponding java.lang.reflect.Method object.
getDeclaringClass
public java.lang.Class getDeclaringClass()
- Overrides:
- getDeclaringClass in class LocalField
eval
public java.lang.Object eval(java.lang.Object obj,
java.lang.Object[] params)
throws java.lang.Exception
- Description copied from interface: Member
- Evaluates the member.
Looks up the value of the field or calls the method.
Not all members can be evaluated, for example non static final
local fields can not since they exist only in compiler's memory.
- Overrides:
- eval in class LocalField
- Tags copied from interface: Member
- Parameters:
obj
- this pointer of corresponding object.params
- array of parameters wrapped in reflection objects.- Returns:
- the result wrapped in a reflection object.