openjava.mop
Class OJField
java.lang.Object
|
+--openjava.mop.OJField
- All Implemented Interfaces:
- Cloneable, OJMember
- public class OJField
- extends Object
- implements OJMember, Cloneable
substance
private OJFieldImp substance
table
private static Hashtable table
OJField
OJField(Field java_field)
OJField
public OJField(OJClass declarer,
OJModifier modif,
OJClass type,
String name)
OJField
public OJField(Environment env,
OJClass declarer,
FieldDeclaration d)
forField
public static OJField forField(Field java_field)
arrayForFields
public static OJField[] arrayForFields(Field[] jfields)
signature
public Signature signature()
- Specified by:
signature
in interface OJMember
getDeclaringClass
public OJClass getDeclaringClass()
- Specified by:
getDeclaringClass
in interface OJMember
getName
public String getName()
- Specified by:
getName
in interface OJMember
getIdentifiableName
public String getIdentifiableName()
getModifiers
public OJModifier getModifiers()
- Specified by:
getModifiers
in interface OJMember
getType
public OJClass getType()
equals
public boolean equals(Object obj)
- Compares this field against the given object.
The algorithm is borrowed by java.lang.reflect.Field.equals().
- Overrides:
equals
in class Object
- See Also:
Field.equals(java.lang.Object)
hashCode
public int hashCode()
- Computes a hashcode for this field.
- Overrides:
hashCode
in class Object
- Returns:
- hash code.
toString
public String toString()
- Overrides:
toString
in class Object
getEnvironment
public Environment getEnvironment()
- Specified by:
getEnvironment
in interface OJMember
get
public Object get(Object obj)
throws IllegalArgumentException,
IllegalAccessException
- Obtains the field value specified by this field object on
the given object.
- Throws:
IllegalArgumentException
- if this field is not
compiled yet.
IllegalAccessException
getBoolean
public boolean getBoolean(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getByte
public byte getByte(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getChar
public char getChar(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getShort
public short getShort(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getInt
public int getInt(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getLong
public long getLong(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getFloat
public float getFloat(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
getDouble
public double getDouble(Object obj)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
set
public void set(Object obj,
Object value)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setBoolean
public void setBoolean(Object obj,
boolean z)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setByte
public void setByte(Object obj,
byte b)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setChar
public void setChar(Object obj,
char c)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setShort
public void setShort(Object obj,
short s)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setInt
public void setInt(Object obj,
int i)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setLong
public void setLong(Object obj,
long l)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setFloat
public void setFloat(Object obj,
float f)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
setDouble
public void setDouble(Object obj,
double d)
throws IllegalArgumentException,
IllegalAccessException
IllegalArgumentException
IllegalAccessException
isExecutable
public boolean isExecutable()
isAlterable
public boolean isAlterable()
getByteCode
public final Field getByteCode()
throws CannotExecuteException
CannotExecuteException
getSourceCode
public final FieldDeclaration getSourceCode()
throws CannotAlterException
CannotAlterException
getCopy
public OJField getCopy()
setDeclaringClass
public void setDeclaringClass(OJClass parent)
throws CannotAlterException
CannotAlterException
setName
public final void setName(String name)
throws CannotAlterException
CannotAlterException
setModifiers
public final void setModifiers(int mods)
throws CannotAlterException
CannotAlterException
setModifiers
public final void setModifiers(OJModifier mods)
throws CannotAlterException
CannotAlterException
setType
public final void setType(OJClass type)
throws CannotAlterException
CannotAlterException