gnu.bytecode

Class Field

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()
ClassType
getDeclaringClass()
int
getFlags()
int
getModifiers()
Field
getNext()
java.lang.reflect.Field
getReflectField()
String
getSourceName()
boolean
getStaticFlag()
static Field
searchField(Field fields, String name)
Find a field with the given name.
void
setAttributes(Attribute attributes)
void
setConstantValue(Object value, ClassType ctype)
Set the ConstantValue attribute for this field.
void
setSourceName(String name)
void
setStaticFlag(boolean is_static)
String
toString()

Methods inherited from class gnu.bytecode.Location

getName, getSignature, getType, setName, setName, setSignature, setType

Constructor Details

Field

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

Method Details

getAttributes

public final Attribute getAttributes()
Specified by:
getAttributes in interface AttrContainer

getDeclaringClass

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

getFlags

public final int getFlags()

getModifiers

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

getNext

public final Field getNext()

getReflectField

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

getSourceName

public String getSourceName()

getStaticFlag

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

searchField

public static Field searchField(Field fields,
                                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

setAttributes

public final void setAttributes(Attribute attributes)
Specified by:
setAttributes in interface AttrContainer

setConstantValue

public final void setConstantValue(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.

setSourceName

public void setSourceName(String name)

setStaticFlag

public final void setStaticFlag(boolean is_static)

toString

public String toString()