gnu.jel.reflect
Class Method

java.lang.Object
  |
  +--gnu.jel.reflect.LocalField
        |
        +--gnu.jel.reflect.LocalMethod
              |
              +--gnu.jel.reflect.Method
All Implemented Interfaces:
java.lang.reflect.Member, Member

public class Method
extends LocalMethod

Represents a method of already compiled class.


Fields inherited from class gnu.jel.reflect.LocalField
modifiers
 
Fields inherited from interface java.lang.reflect.Member
DECLARED, PUBLIC
 
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 gnu.jel.reflect.LocalMethod
equals, getExceptionTypes, getParameterTypes
 
Methods inherited from class gnu.jel.reflect.LocalField
getModifiers, getName, getType, getTypeID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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
Following copied from interface: gnu.jel.reflect.Member
Parameters:
obj - this pointer of corresponding object.
params - array of parameters wrapped in reflection objects.
Returns:
the result wrapped in a reflection object.