public class FieldInfo extends MemberInfo
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONSTANT_VALUE |
cf, DEPRECATED, RUNTIME_VISIBLE_ANNOTATIONS, SIGNATURE| Constructor and Description |
|---|
FieldInfo(ClassFile cf,
int accessFlags,
int nameIndex,
int descriptorIndex)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(AttributeInfo info)
Adds the specified attribute to this field.
|
AttributeInfo |
getAttribute(int index)
Returns the specified attribute.
|
int |
getAttributeCount()
Returns the number of attributes of this field.
|
java.lang.String |
getConstantValueAsString() |
java.lang.String |
getDescriptor()
Returns the field descriptor of this field.
|
java.lang.String |
getName()
Returns the name of this member.
|
int |
getNameIndex()
Returns the index into the constant pool of a
ConstantUtf8Info
structure representing the field name, as a simple name. |
java.lang.String |
getTypeString(boolean qualified)
Returns the type of this field, as determined from its field descriptor.
|
boolean |
isConstant() |
static FieldInfo |
read(ClassFile cf,
java.io.DataInputStream in)
Reads a
FieldInfo structure from the specified input
stream. |
getAccessFlags, getClassFile, isDeprecated, isFinal, isStatic, readAttributepublic static final java.lang.String CONSTANT_VALUE
public FieldInfo(ClassFile cf, int accessFlags, int nameIndex, int descriptorIndex)
AccessFlagspublic void addAttribute(AttributeInfo info)
info - Information about the attribute.public AttributeInfo getAttribute(int index)
index - The index of the attribute.public int getAttributeCount()
public java.lang.String getConstantValueAsString()
public java.lang.String getDescriptor()
getDescriptor in class MemberInfopublic java.lang.String getName()
getName in class MemberInfopublic int getNameIndex()
ConstantUtf8Info
structure representing the field name, as a simple name.public java.lang.String getTypeString(boolean qualified)
public boolean isConstant()
public static FieldInfo read(ClassFile cf, java.io.DataInputStream in) throws java.io.IOException
FieldInfo structure from the specified input
stream.cf - The class file containing this field.in - The input stream to read from.java.io.IOException - If an IO error occurs.