gnu.bytecode
Class Field
java.lang.Object
gnu.bytecode.Location
gnu.bytecode.Field
- All Implemented Interfaces:
- AttrContainer
public class Field
- extends Location
- implements AttrContainer
Constructor Summary |
Field(ClassType ctype)
Add a new Field to a ClassType. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field
public Field(ClassType ctype)
- Add a new Field to a ClassType.
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()
setStaticFlag
public final void setStaticFlag(boolean is_static)
getStaticFlag
public final boolean getStaticFlag()
getFlags
public final int getFlags()
getModifiers
public final int getModifiers()
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 searchname
- (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 fieldctype
- 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