com.go.trove.classfile
Class FieldInfo

java.lang.Object
  |
  +--com.go.trove.classfile.FieldInfo

public class FieldInfo
extends java.lang.Object

This class corresponds to the field_info structure as defined in section 4.5 of The Java Virtual Machine Specification.

Version:
24 , 00/11/27
Author:
Brian S O'Neill
See Also:
ClassFile

Method Summary
 void addAttribute(Attribute attr)
           
 AccessFlags getAccessFlags()
          Returns a copy of this field's access flags.
 Attribute[] getAttributes()
           
 ClassFile getClassFile()
          Returns the parent ClassFile for this FieldInfo.
 ConstantInfo getConstantValue()
          Returns the constant value for this field or null if no constant set.
 ConstantUTFInfo getDescriptorConstant()
          Returns a constant from the constant pool with this field's type descriptor string.
 int getLength()
          Returns the length (in bytes) of this object in the class file.
 java.lang.String getName()
          Returns the name of this field.
 ConstantUTFInfo getNameConstant()
          Returns a constant from the constant pool with this field's name.
 TypeDescriptor getType()
          Returns the type of this field.
 boolean isDeprecated()
           
 boolean isSynthetic()
           
 void markDeprecated()
          Mark this field as being deprecated by adding a special attribute.
 void markSynthetic()
          Mark this field as being synthetic by adding a special attribute.
 void setConstantValue(double value)
          Set the constant value for this field as a double.
 void setConstantValue(float value)
          Set the constant value for this field as a float.
 void setConstantValue(int value)
          Set the constant value for this field as an int.
 void setConstantValue(long value)
          Set the constant value for this field as a long.
 void setConstantValue(java.lang.String value)
          Set the constant value for this field as a string.
 java.lang.String toString()
           
 void writeTo(java.io.DataOutput dout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getClassFile

public ClassFile getClassFile()
Returns the parent ClassFile for this FieldInfo.

getName

public java.lang.String getName()
Returns the name of this field.

getType

public TypeDescriptor getType()
Returns the type of this field.

getAccessFlags

public AccessFlags getAccessFlags()
Returns a copy of this field's access flags.

getNameConstant

public ConstantUTFInfo getNameConstant()
Returns a constant from the constant pool with this field's name.

getDescriptorConstant

public ConstantUTFInfo getDescriptorConstant()
Returns a constant from the constant pool with this field's type descriptor string.
See Also:
TypeDescriptor

getConstantValue

public ConstantInfo getConstantValue()
Returns the constant value for this field or null if no constant set.

isSynthetic

public boolean isSynthetic()

isDeprecated

public boolean isDeprecated()

setConstantValue

public void setConstantValue(int value)
Set the constant value for this field as an int.

setConstantValue

public void setConstantValue(float value)
Set the constant value for this field as a float.

setConstantValue

public void setConstantValue(long value)
Set the constant value for this field as a long.

setConstantValue

public void setConstantValue(double value)
Set the constant value for this field as a double.

setConstantValue

public void setConstantValue(java.lang.String value)
Set the constant value for this field as a string.

markSynthetic

public void markSynthetic()
Mark this field as being synthetic by adding a special attribute.

markDeprecated

public void markDeprecated()
Mark this field as being deprecated by adding a special attribute.

addAttribute

public void addAttribute(Attribute attr)

getAttributes

public Attribute[] getAttributes()

getLength

public int getLength()
Returns the length (in bytes) of this object in the class file.

writeTo

public void writeTo(java.io.DataOutput dout)
             throws java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object