public final class FieldInfo
extends java.lang.Object
field_info structure.CtField.getFieldInfo()| Modifier and Type | Field and Description |
|---|---|
(package private) int |
accessFlags |
(package private) java.util.ArrayList |
attribute |
(package private) java.lang.String |
cachedName |
(package private) java.lang.String |
cachedType |
(package private) ConstPool |
constPool |
(package private) int |
descriptor |
(package private) int |
name |
| Modifier | Constructor and Description |
|---|---|
private |
FieldInfo(ConstPool cp) |
(package private) |
FieldInfo(ConstPool cp,
java.io.DataInputStream in) |
|
FieldInfo(ConstPool cp,
java.lang.String fieldName,
java.lang.String desc)
Constructs a
field_info structure. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(AttributeInfo info)
Appends an attribute.
|
(package private) void |
compact(ConstPool cp)
Copies all constant pool items to a given new constant pool
and replaces the original items with the new ones.
|
int |
getAccessFlags()
Returns the access flags.
|
AttributeInfo |
getAttribute(java.lang.String name)
Returns the attribute with the specified name.
|
java.util.List |
getAttributes()
Returns all the attributes.
|
int |
getConstantValue()
Finds a ConstantValue attribute and returns the index into
the
constant_pool table. |
ConstPool |
getConstPool()
Returns the constant pool table used
by this
field_info. |
java.lang.String |
getDescriptor()
Returns the field descriptor.
|
java.lang.String |
getName()
Returns the field name.
|
(package private) void |
prune(ConstPool cp) |
private void |
read(java.io.DataInputStream in) |
void |
setAccessFlags(int acc)
Sets the access flags.
|
void |
setDescriptor(java.lang.String desc)
Sets the field descriptor.
|
void |
setName(java.lang.String newName)
Sets the field name.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
(package private) void |
write(java.io.DataOutputStream out) |
ConstPool constPool
int accessFlags
int name
java.lang.String cachedName
java.lang.String cachedType
int descriptor
java.util.ArrayList attribute
private FieldInfo(ConstPool cp)
public FieldInfo(ConstPool cp, java.lang.String fieldName, java.lang.String desc)
field_info structure.cp - a constant pool tablefieldName - field namedesc - field descriptorDescriptorFieldInfo(ConstPool cp, java.io.DataInputStream in) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectvoid compact(ConstPool cp)
cp - the destinationvoid prune(ConstPool cp)
public ConstPool getConstPool()
field_info.public java.lang.String getName()
public void setName(java.lang.String newName)
public int getAccessFlags()
AccessFlagpublic void setAccessFlags(int acc)
AccessFlagpublic java.lang.String getDescriptor()
Descriptorpublic void setDescriptor(java.lang.String desc)
Descriptorpublic int getConstantValue()
constant_pool table.public java.util.List getAttributes()
List object
is shared with this object. If you add a new attribute to the list,
the attribute is also added to the field represented by this
object. If you remove an attribute from the list, it is also removed
from the field.AttributeInfo objects.AttributeInfopublic AttributeInfo getAttribute(java.lang.String name)
name - attribute namegetAttributes()public void addAttribute(AttributeInfo info)
getAttributes()private void read(java.io.DataInputStream in)
throws java.io.IOException
java.io.IOExceptionvoid write(java.io.DataOutputStream out)
throws java.io.IOException
java.io.IOException