gnu.bytecode
Class Field

java.lang.Object
  extended by gnu.bytecode.Location
      extended by gnu.bytecode.Field
All Implemented Interfaces:
AttrContainer, Member

public class Field
extends Location
implements AttrContainer, Member


Field Summary
 
Fields inherited from class gnu.bytecode.Location
name, type
 
Constructor Summary
Field(ClassType ctype)
          Add a new Field to a ClassType.
 
Method Summary
 Attribute getAttributes()
          Get the (first) Attribute of this container.
 ClassType getDeclaringClass()
           
 int getFlags()
           
 int getModifiers()
           
 Field getNext()
           
 java.lang.reflect.Field getReflectField()
           
 java.lang.String getSourceName()
           
 boolean getStaticFlag()
           
static Field searchField(Field fields, java.lang.String name)
          Find a field with the given name.
 void setAttributes(Attribute attributes)
          Set the (list of) Attributes of this container.
 void setConstantValue(java.lang.Object value, ClassType ctype)
          Set the ConstantValue attribute for this field.
 void setSourceName(java.lang.String name)
           
 void setStaticFlag(boolean is_static)
           
 java.lang.String toString()
           
 
Methods inherited from class gnu.bytecode.Location
getName, getSignature, getType, setName, setName, setSignature, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gnu.bytecode.Member
getName, setName
 

Constructor Detail

Field

public Field(ClassType ctype)
Add a new Field to a ClassType.

Method Detail

getAttributes

public final Attribute getAttributes()
Description copied from interface: AttrContainer
Get the (first) Attribute of this container.

Specified by:
getAttributes in interface AttrContainer

setAttributes

public final void setAttributes(Attribute attributes)
Description copied from interface: AttrContainer
Set the (list of) Attributes of this container.

Specified by:
setAttributes in interface AttrContainer

getDeclaringClass

public final ClassType getDeclaringClass()
Specified by:
getDeclaringClass in interface Member

setStaticFlag

public final void setStaticFlag(boolean is_static)

getStaticFlag

public final boolean getStaticFlag()
Specified by:
getStaticFlag in interface Member

getFlags

public final int getFlags()

getModifiers

public final int getModifiers()
Specified by:
getModifiers in interface Member

getReflectField

public java.lang.reflect.Field getReflectField()
                                        throws java.lang.NoSuchFieldException
Throws:
java.lang.NoSuchFieldException

setSourceName

public void setSourceName(java.lang.String name)

getSourceName

public java.lang.String getSourceName()

searchField

public static Field searchField(Field fields,
                                java.lang.String name)
Find a field with the given name.

Parameters:
fields - list of fields to search
name - (interned source) name of field to look for

getNext

public final Field getNext()

setConstantValue

public final void setConstantValue(java.lang.Object value,
                                   ClassType ctype)
Set the ConstantValue attribute for this field.

Parameters:
value - the value to use for the ConstantValue attribute of this field
ctype - the class that contains this field This field's type is used to determine the kind of constant.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object