|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gnu.jel.reflect.LocalField
Represents a field local to the class being compiled.
Field Summary | |
protected int |
modifiers
|
Fields inherited from interface java.lang.reflect.Member |
DECLARED,
PUBLIC |
Constructor Summary | |
LocalField(int modifiers,
java.lang.Class type,
java.lang.String name,
java.lang.Object constValue)
Constructs a new local field. |
Method Summary | |
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
eval(java.lang.Object obj,
java.lang.Object[] params)
Evaluates the member. |
java.lang.Class |
getDeclaringClass()
|
int |
getModifiers()
Returns modifiers and more. |
java.lang.String |
getName()
|
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 class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int modifiers
Constructor Detail |
public LocalField(int modifiers, java.lang.Class type, java.lang.String name, java.lang.Object constValue)
modifiers
- field modifiers, a sum of one or more of PUBLIC,
PRIVATE,PROTECTED, STATIC,
FINAL,VOLATILE, TRANSIENT
constants defined in java.lang.reflect.Modifiertype
- is a class representing the type of this field.name
- is the name of this field.constValue
- is the value of this field if it is static final,
null otherwise.Method Detail |
public java.lang.Class getDeclaringClass()
public java.lang.String getName()
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 ()
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 boolean equals(java.lang.Object o)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |