org.fife.rsta.ac.java.classreader
Class FieldInfo

java.lang.Object
  extended by org.fife.rsta.ac.java.classreader.MemberInfo
      extended by org.fife.rsta.ac.java.classreader.FieldInfo

public class FieldInfo
extends MemberInfo

Represents a "field_info" structure as defined by the Java VM spec.

Version:
1.0
Author:
Robert Futrell

Field Summary
static String CONSTANT_VALUE
           
 
Fields inherited from class org.fife.rsta.ac.java.classreader.MemberInfo
cf, DEPRECATED
 
Constructor Summary
FieldInfo(ClassFile cf, int accessFlags, int nameIndex, int descriptorIndex)
          Constructor.
 
Method Summary
 void addAttribute(AttributeInfo info)
          Adds the specified attribute to this field.
 AttributeInfo getAttribute(int index)
          Returns the specified attribute.
 int getAttributeCount()
          Returns the number of attributes of this field.
 String getConstantValueAsString()
           
 String getDescriptor()
          Returns the field descriptor of this field.
 String getName()
          Returns the name of this member.
 int getNameIndex()
          Returns the index into the constant pool of a ConstantUtf8Info structure representing the field name, as a simple name.
 String getTypeString()
          Returns the type of this field, as determined from its field descriptor.
 boolean isConstant()
           
static FieldInfo read(ClassFile cf, DataInputStream in)
          Reads a FieldInfo structure from the specified input stream.
 
Methods inherited from class org.fife.rsta.ac.java.classreader.MemberInfo
getAccessFlags, getClassFile, isDeprecated, isFinal, isStatic, readAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_VALUE

public static final String CONSTANT_VALUE
See Also:
Constant Field Values
Constructor Detail

FieldInfo

public FieldInfo(ClassFile cf,
                 int accessFlags,
                 int nameIndex,
                 int descriptorIndex)
Constructor.

See Also:
AccessFlags
Method Detail

addAttribute

public void addAttribute(AttributeInfo info)
Adds the specified attribute to this field.

Parameters:
info - Information about the attribute.

getAttribute

public AttributeInfo getAttribute(int index)
Returns the specified attribute.

Parameters:
index - The index of the attribute.
Returns:
The attribute.

getAttributeCount

public int getAttributeCount()
Returns the number of attributes of this field.

Returns:
The number of attributes.

getConstantValueAsString

public String getConstantValueAsString()

getDescriptor

public String getDescriptor()
Returns the field descriptor of this field.

Specified by:
getDescriptor in class MemberInfo
Returns:
The field descriptor of this field.

getName

public String getName()
Returns the name of this member.

Specified by:
getName in class MemberInfo
Returns:
The name of this member.

getNameIndex

public int getNameIndex()
Returns the index into the constant pool of a ConstantUtf8Info structure representing the field name, as a simple name.

Returns:
The index into the constant pool.

getTypeString

public String getTypeString()
Returns the type of this field, as determined from its field descriptor.

Returns:
The type of this field.

isConstant

public boolean isConstant()

read

public static FieldInfo read(ClassFile cf,
                             DataInputStream in)
                      throws IOException
Reads a FieldInfo structure from the specified input stream.

Parameters:
cf - The class file containing this field.
in - The input stream to read from.
Returns:
The field information read.
Throws:
IOException - If an IO error occurs.


Copyright © 2003-2011. All Rights Reserved.