|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a member of a class, which is field or method.
Fields inherited from interface java.lang.reflect.Member |
DECLARED, PUBLIC |
Method Summary | |
void |
code(ClassFile cf)
Generates the code for invocation of this member. |
java.lang.Object |
eval(java.lang.Object obj,
java.lang.Object[] params)
Evaluates the member. |
int |
getModifiers()
Returns modifiers and more. |
java.lang.Class[] |
getParameterTypes()
Used to get types and number of parameters needed to evaluate this member. |
java.lang.Class |
getType()
Used to get the type of this member. |
int |
getTypeID()
Returns an integer identifier of this member type. |
Methods inherited from interface java.lang.reflect.Member |
getDeclaringClass, getName |
Method Detail |
public int getModifiers()
This method returns modifiers of the method in the less significant half of the returned int, and the type of member in the other part. The members are encoded according to the following scheme.
1 - field 2 - method 3 - constructor ()
getModifiers
in interface java.lang.reflect.Member
public java.lang.Class getType()
For fields it is the field type, for methods it is the method return value.
Primitive types are encoded as TYPE fields of corresponding reflection objects.
public int getTypeID()
For performance and indexing reasons JEL encodes all Java types by integers. The encoding is defined in gnu.jel.TypesStack class. This method returns an integer encoding of this member's type.
public java.lang.Class[] getParameterTypes()
Is there are no parameters (like for fields) it returns an array of length zero.
public java.lang.Object eval(java.lang.Object obj, java.lang.Object[] params) throws java.lang.Exception
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.
obj
- this pointer of corresponding object.params
- array of parameters wrapped in reflection objects.public void code(ClassFile cf)
For field/variable invoke means to get value. No type checks are performed.
cf
- classfile to append instructions to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |