Class FieldInfo

java.lang.Object
  |
  +--JavaElement
        |
        +--FieldInfo

class FieldInfo
extends JavaElement
implements JVM


Field Summary
(package private)  int access_flags
           
(package private)  AttributeTable attributes
           
(package private)  Klass cls
           
(package private)  int fieldIndex
          the (globally unique) index of this needed static field.
(package private)  boolean inStaticInitializer
           
(package private)  java.lang.String name
           
(package private)  int offset
          offset of this field in the instance's layout.
(package private)  ConstantPool pool
           
(package private)  java.lang.String signature
           
(package private)  int size
          byte size of this field.
 
Fields inherited from class JavaElement
EXACT_INSTANCE_NEEDED, INSTANCE_NEEDED, NEEDED, NEEDED_INSTANCEOF, NEEDED_VIRTUALLY, neededModeAddOn, neededModeBasic, neededReasons, UNNEEDED
 
Constructor Summary
(package private) FieldInfo(Klass cls, ConstantPool pool, java.io.DataInput in)
          create a FieldInfo from a section of a class file.
(package private) FieldInfo(Klass cls, java.lang.String name, java.lang.String signature)
          create a FieldInfo for a 'normal' field.
 
Method Summary
(package private)  int computeSize()
          compute the byte size of this field.
(package private)  void report()
           
(package private)  java.lang.String shortLabel()
          the short label of this static field.
 java.lang.String toString()
          field name, prefixed by class
(package private)  void updateNeeded()
          update the 'needed' state of this field and all related elements.
(package private)  void write(java.io.DataOutput out)
          write this field to a classfile.
 
Methods inherited from class JavaElement
isNeeded, isNeeded, markNeeded
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

access_flags

int access_flags

attributes

AttributeTable attributes

pool

ConstantPool pool

cls

Klass cls

name

java.lang.String name

signature

java.lang.String signature

inStaticInitializer

boolean inStaticInitializer

fieldIndex

int fieldIndex
the (globally unique) index of this needed static field. Unneeded or instance fields have -1.

offset

int offset
offset of this field in the instance's layout.

size

int size
byte size of this field.
Constructor Detail

FieldInfo

FieldInfo(Klass cls,
          java.lang.String name,
          java.lang.String signature)
create a FieldInfo for a 'normal' field. It's a non-static field with default access.
Parameters:
cls - description of the defining class
name - name of field
signature - the field's type signature

FieldInfo

FieldInfo(Klass cls,
          ConstantPool pool,
          java.io.DataInput in)
    throws java.io.IOException
create a FieldInfo from a section of a class file. The FieldInfo is filled by reading from a stream. On entry, the stream is positioned to the beginning of the field_info structure. The method leaves the stream positioned immediately after the end of this structure.
Parameters:
cls - description of the defining class
pool - the constant pool - already read from the class file
in - the stream to read exactly 1 field_info structure from
Method Detail

computeSize

int computeSize()
compute the byte size of this field.

write

void write(java.io.DataOutput out)
     throws java.io.IOException
write this field to a classfile.

updateNeeded

void updateNeeded()
update the 'needed' state of this field and all related elements.

If non-static field is needed, its class is needed, too. We also need the class for the field's declared type.

Overrides:
updateNeeded in class JavaElement

shortLabel

java.lang.String shortLabel()
the short label of this static field.

toString

public java.lang.String toString()
field name, prefixed by class
Overrides:
toString in class java.lang.Object

report

void report()