All Packages Class Hierarchy This Package Previous Next Index
Class DE.fub.inf.JVM.JavaClass.Field
java.lang.Object
|
+----DE.fub.inf.JVM.JavaClass.Field
- public final class Field
- extends Object
- implements Constants
This class represents the field info structure, i.e. the representation
for a variable in the class. See JVM specification for details.
- Version:
- 970922
- Author:
- M. Dahm
-
Field()
- Empty constructor, all attributes have to be defined via `setXXX'
methods.
-
Field(Field)
- Initialize from another object.
-
Field(short, short, short, Attribute[], ConstantPool)
-
-
accept(Visitor)
- Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class.
-
dump(DataOutputStream)
- Dump field to file stream on binary format.
-
getAccessFlags()
-
-
getAttributes()
-
-
getConstantPool()
-
-
getName()
-
-
getNameIndex()
-
-
getSignature()
-
-
getSignatureIndex()
-
-
setAccessFlags(short)
-
-
setAttributes(Attribute[])
-
-
setConstantPool(ConstantPool)
-
-
setNameIndex(short)
-
-
setSignatureIndex(short)
-
-
toString()
- Return string representation close to declaration format,
`public static final short MAX = 100', e.g..
Field
public Field()
- Empty constructor, all attributes have to be defined via `setXXX'
methods. Use at your own risk.
Field
public Field(Field c)
- Initialize from another object. Note that both objects use the same
references (shallow copy). Use clone() for a physical copy.
Field
public Field(short access_flags,
short name_index,
short signature_index,
Attribute attributes[],
ConstantPool constant_pool)
- Parameters:
- access_flags - Access rights of field
- name_index - Points to field name in constant pool
- signature_index - Points to encoded signature
- attributes - Collection of attributes
- constant_pool - Array of constants
accept
public void accept(Visitor v)
- Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. I.e., the hierarchy of methods,
fields, attributes, etc. spawns a tree of objects.
- Parameters:
- v - Visitor object
dump
public final void dump(DataOutputStream file) throws IOException
- Dump field to file stream on binary format.
- Parameters:
- file - Output file stream
getAccessFlags
public final short getAccessFlags()
- Returns:
- Access flags of the class field.
getAttributes
public final Attribute[] getAttributes()
- Returns:
- Collection of field attributes.
getConstantPool
public final ConstantPool getConstantPool()
- Returns:
- Constant pool used by this object.
- See Also:
- ConstantPool
getName
public final String getName()
- Returns:
- Name of field
getNameIndex
public final short getNameIndex()
- Returns:
- Index in constant pool of field name.
getSignature
public final String getSignature()
- Returns:
- String representation of field type signature (java style)
getSignatureIndex
public final short getSignatureIndex()
- Returns:
- Index in constant pool of field signature.
setAccessFlags
public final void setAccessFlags(short access_flags)
setAttributes
public final void setAttributes(Attribute attributes[])
setConstantPool
public final void setConstantPool(ConstantPool constant_pool)
- Parameters:
- constant_pool - Constant pool to be used for this object.
- See Also:
- ConstantPool
setNameIndex
public final void setNameIndex(short name_index)
setSignatureIndex
public final void setSignatureIndex(short signature_index)
toString
public final String toString()
- Return string representation close to declaration format,
`public static final short MAX = 100', e.g..
- Returns:
- String representation of field, including the signature.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index