|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vladium.jcd.cls.Field_info
Each class field is described by a variable-length field_info structure. The format of this structure is
field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; }The value of the access_flags item is a mask of modifiers used to describe access permission to and properties of a field.
The value of the name_index item must be a valid index into the constant pool
table. The constant pool entry at that index must be a CONSTANT_Utf8_info
structure which must represent a valid Java field name stored as a simple (not
fully qualified) name, that is, as a Java identifier.
The value of the descriptor_index item must be a valid index into the constant
pool table. The constant pool entry at that index must be a
CONSTANT_Utf8_info
structure which must represent a valid Java field
descriptor.
Each value of the attributes table must be a variable-length attribute structure.
A field can have any number of attributes associated with it. The only attribute
defined for the attributes table of a field_info structure at the moment
is the ConstantValue attribute -- see ConstantValueAttribute_info
.
Field Summary | |
private static boolean |
DEBUG
|
private int |
m_access_flags
|
private IAttributeCollection |
m_attributes
|
int |
m_descriptor_index
|
int |
m_name_index
|
Fields inherited from interface com.vladium.jcd.cls.IAccessFlags |
ACC_ABSTRACT, ACC_BRIDGE, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, ALL_ACC, ALL_ACC_NAMES |
Constructor Summary | |
Field_info(IConstantCollection constants,
UDataInputStream bytes)
|
|
Field_info(int access_flags,
int name_index,
int descriptor_index,
IAttributeCollection attributes)
|
Method Summary | |
java.lang.Object |
clone()
Performs a deep copy. |
int |
getAccessFlags()
|
IAttributeCollection |
getAttributes()
|
java.lang.String |
getDescriptor(ClassDef cls)
Returns the descriptor string for this field within the context of 'cls' class definition. |
java.lang.String |
getName(ClassDef cls)
Returns the field name within the context of 'cls' class definition. |
boolean |
isSynthetic()
|
void |
setAccessFlags(int flags)
|
java.lang.String |
toString()
|
void |
writeInClassFormat(UDataOutputStream out)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int m_name_index
public int m_descriptor_index
private int m_access_flags
private IAttributeCollection m_attributes
private static final boolean DEBUG
Constructor Detail |
public Field_info(int access_flags, int name_index, int descriptor_index, IAttributeCollection attributes)
public Field_info(IConstantCollection constants, UDataInputStream bytes) throws java.io.IOException
Method Detail |
public java.lang.String getName(ClassDef cls)
cls
- class that contains this field
public java.lang.String getDescriptor(ClassDef cls)
cls
- class that contains this field
public boolean isSynthetic()
public final void setAccessFlags(int flags)
setAccessFlags
in interface IAccessFlags
public final int getAccessFlags()
getAccessFlags
in interface IAccessFlags
public IAttributeCollection getAttributes()
public java.lang.String toString()
public java.lang.Object clone()
public void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |