FieldInfopublic class Field extends java.lang.Object implements FieldInfo
ConstantValue| Constructor | Description |
|---|---|
Field(java.io.DataInputStream in,
ClassInfo classInfo) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
constantValue() |
Get the index into the constant pool of the field's constant value, if
any.
|
ClassInfo |
declaringClass() |
Get the class which declared the field.
|
int |
modifiers() |
Get the modifiers of the field.
|
int |
nameIndex() |
Get the index into the constant pool of the name of the field.
|
void |
setConstantValue(int index) |
Set the index into the constant pool of the field's constant value.
|
void |
setModifiers(int modifiers) |
Set the modifiers of the field.
|
void |
setNameIndex(int name) |
Set the index into the constant pool of the name of the field.
|
void |
setTypeIndex(int type) |
Set the index into the constant pool of the type of the field.
|
java.lang.String |
toString() |
Convert the field to a string.
|
int |
typeIndex() |
Get the index into the constant pool of the type of the field.
|
void |
write(java.io.DataOutputStream out) |
Write the field to a class file.
|
public Field(java.io.DataInputStream in,
ClassInfo classInfo)
throws java.io.IOException
in - The data stream of the class file.classInfo - The class file containing the field.java.io.IOException - If an error occurs while reading.public ClassInfo declaringClass()
declaringClass in interface FieldInfopublic void setNameIndex(int name)
setNameIndex in interface FieldInfoname - The name of the field.public void setTypeIndex(int type)
setTypeIndex in interface FieldInfotype - The type of the field.public int nameIndex()
public int typeIndex()
public void setModifiers(int modifiers)
setModifiers in interface FieldInfomodifiers - A bit vector of modifier flags for the field.Modifierspublic int modifiers()
public int constantValue()
constantValue in interface FieldInfoClassInfo.constants()public void setConstantValue(int index)
setConstantValue in interface FieldInfoClassInfo.constants()public void write(java.io.DataOutputStream out)
throws java.io.IOException
out - The data stream of the class file.java.io.IOException - If an error occurs while writing.public java.lang.String toString()
toString in class java.lang.Object