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 AttributeGet the (first) Attribute of this container.final ConstantPoolfinal ClassTypefinal intgetFlags()final intfinal FieldgetNext()final booleangetType()booleanstatic FieldsearchField(Field fields, String name) Find a field with the given name.final voidsetAttributes(Attribute attributes) Set the (list of) Attributes of this container.final voidsetConstantValue(Object value, ClassType ctype) Set the ConstantValue attribute for this field.final voidsetModifiers(int modifiers) voidsetSourceName(String name) final voidsetStaticFlag(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:AttrContainerGet the (first) Attribute of this container.- Specified by:
getAttributesin interfaceAttrContainer
-
setAttributes
Description copied from interface:AttrContainerSet the (list of) Attributes of this container.- Specified by:
setAttributesin interfaceAttrContainer
-
getDeclaringClass
- Specified by:
getDeclaringClassin interfaceMember
-
getConstants
- Specified by:
getConstantsin interfaceAttrContainer
-
setStaticFlag
public final void setStaticFlag(boolean is_static) -
getStaticFlag
public final boolean getStaticFlag()- Specified by:
getStaticFlagin interfaceMember
-
getFlags
public final int getFlags() -
getModifiers
public final int getModifiers()- Specified by:
getModifiersin interfaceMember
-
setModifiers
public final void setModifiers(int modifiers) -
getType
-
getReflectField
- Throws:
NoSuchFieldException
-
getAnnotation
- Specified by:
getAnnotationin 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
-