openjava.mop
Class OJField

java.lang.Object
  |
  +--openjava.mop.OJField
All Implemented Interfaces:
Cloneable, OJMember

public class OJField
extends Object
implements OJMember, Cloneable


Field Summary
private  OJFieldImp substance
           
private static Hashtable table
           
 
Fields inherited from interface openjava.mop.OJMember
DECLARED, PUBLIC
 
Constructor Summary
  OJField(Environment env, OJClass declarer, FieldDeclaration d)
           
(package private) OJField(Field java_field)
           
  OJField(OJClass declarer, OJModifier modif, OJClass type, String name)
           
 
Method Summary
static OJField[] arrayForFields(Field[] jfields)
           
 boolean equals(Object obj)
          Compares this field against the given object.
static OJField forField(Field java_field)
           
 Object get(Object obj)
          Obtains the field value specified by this field object on the given object.
 boolean getBoolean(Object obj)
           
 byte getByte(Object obj)
           
 Field getByteCode()
           
 char getChar(Object obj)
           
 OJField getCopy()
           
 OJClass getDeclaringClass()
           
 double getDouble(Object obj)
           
 Environment getEnvironment()
           
 float getFloat(Object obj)
           
 String getIdentifiableName()
           
 int getInt(Object obj)
           
 long getLong(Object obj)
           
 OJModifier getModifiers()
           
 String getName()
           
 short getShort(Object obj)
           
 FieldDeclaration getSourceCode()
           
 OJClass getType()
           
 int hashCode()
          Computes a hashcode for this field.
 boolean isAlterable()
           
 boolean isExecutable()
           
 void set(Object obj, Object value)
           
 void setBoolean(Object obj, boolean z)
           
 void setByte(Object obj, byte b)
           
 void setChar(Object obj, char c)
           
 void setDeclaringClass(OJClass parent)
           
 void setDouble(Object obj, double d)
           
 void setFloat(Object obj, float f)
           
 void setInt(Object obj, int i)
           
 void setLong(Object obj, long l)
           
 void setModifiers(int mods)
           
 void setModifiers(OJModifier mods)
           
 void setName(String name)
           
 void setShort(Object obj, short s)
           
 void setType(OJClass type)
           
 Signature signature()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

substance

private OJFieldImp substance

table

private static Hashtable table
Constructor Detail

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

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

SourceForge.net_Logo