Package gnu.bytecode
Class Field
java.lang.Object
gnu.bytecode.Location
gnu.bytecode.Field
- All Implemented Interfaces:
AttrContainer
,Member
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Annotation>
TgetAnnotation
(Class<T> clas) final Attribute
Get the (first) Attribute of this container.final ConstantPool
final ClassType
final int
getFlags()
final int
final Field
getNext()
final boolean
getType()
boolean
static Field
searchField
(Field fields, String name) Find a field with the given name.final void
setAttributes
(Attribute attributes) Set the (list of) Attributes of this container.final void
setConstantValue
(Object value, ClassType ctype) Set the ConstantValue attribute for this field.final void
setModifiers
(int modifiers) void
setSourceName
(String name) final void
setStaticFlag
(boolean is_static) toString()
Methods inherited from class gnu.bytecode.Location
getName, getSignature, setName, setName, setSignature, setType
-
Constructor Details
-
Field
Add a new Field to a ClassType.
-
-
Method Details
-
getAttributes
Description copied from interface:AttrContainer
Get the (first) Attribute of this container.- Specified by:
getAttributes
in interfaceAttrContainer
-
setAttributes
Description copied from interface:AttrContainer
Set the (list of) Attributes of this container.- Specified by:
setAttributes
in interfaceAttrContainer
-
getDeclaringClass
- Specified by:
getDeclaringClass
in interfaceMember
-
getConstants
- Specified by:
getConstants
in interfaceAttrContainer
-
setStaticFlag
public final void setStaticFlag(boolean is_static) -
getStaticFlag
public final boolean getStaticFlag()- Specified by:
getStaticFlag
in interfaceMember
-
getFlags
public final int getFlags() -
getModifiers
public final int getModifiers()- Specified by:
getModifiers
in interfaceMember
-
setModifiers
public final void setModifiers(int modifiers) -
getType
-
getReflectField
- Throws:
NoSuchFieldException
-
getAnnotation
- Specified by:
getAnnotation
in interfaceMember
-
setSourceName
-
getSourceName
-
searchField
Find a field with the given name.- Parameters:
fields
- list of fields to searchname
- (interned source) name of field to look for
-
getNext
-
setConstantValue
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.
-
hasConstantValueAttr
public boolean hasConstantValueAttr() -
toString
-