javassist.bytecode

Class FieldInfo

public final class FieldInfo extends Object

field_info structure.

See Also: getFieldInfo

Constructor Summary
FieldInfo(ConstPool cp, String fieldName, String desc)
Constructs a field_info structure.
Method Summary
voidaddAttribute(AttributeInfo info)
Appends an attribute.
intgetAccessFlags()
Returns the access flags.
AttributeInfogetAttribute(String name)
Returns the attribute with the specified name.
ListgetAttributes()
Returns all the attributes.
intgetConstantValue()
Finds a ConstantValue attribute and returns the index into the constant_pool table.
ConstPoolgetConstPool()
Returns the constant pool table used by this field_info.
StringgetDescriptor()
Returns the field descriptor.
StringgetName()
Returns the field name.
voidsetAccessFlags(int acc)
Sets the access flags.
voidsetDescriptor(String desc)
Sets the field descriptor.
voidsetName(String newName)
Sets the field name.
StringtoString()
Returns a string representation of the object.

Constructor Detail

FieldInfo

public FieldInfo(ConstPool cp, String fieldName, String desc)
Constructs a field_info structure.

Parameters: cp a constant pool table fieldName field name desc field descriptor

See Also: Descriptor

Method Detail

addAttribute

public void addAttribute(AttributeInfo info)
Appends an attribute. If there is already an attribute with the same name, the new one substitutes for it.

See Also: getAttributes

getAccessFlags

public int getAccessFlags()
Returns the access flags.

See Also: AccessFlag

getAttribute

public AttributeInfo getAttribute(String name)
Returns the attribute with the specified name. It returns null if the specified attribute is not found.

Parameters: name attribute name

See Also: getAttributes

getAttributes

public List getAttributes()
Returns all the attributes. The returned 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.

Returns: a list of AttributeInfo objects.

See Also: AttributeInfo

getConstantValue

public int getConstantValue()
Finds a ConstantValue attribute and returns the index into the constant_pool table.

Returns: 0 if a ConstantValue attribute is not found.

getConstPool

public ConstPool getConstPool()
Returns the constant pool table used by this field_info.

getDescriptor

public String getDescriptor()
Returns the field descriptor.

See Also: Descriptor

getName

public String getName()
Returns the field name.

setAccessFlags

public void setAccessFlags(int acc)
Sets the access flags.

See Also: AccessFlag

setDescriptor

public void setDescriptor(String desc)
Sets the field descriptor.

See Also: Descriptor

setName

public void setName(String newName)
Sets the field name.

toString

public String toString()
Returns a string representation of the object.
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.