javar.attributes
Class Attribute

java.lang.Object
  |
  +--javar.attributes.Attribute
Direct Known Subclasses:
ConstantValue, Deprecated, InnerClasses, LineNumberTable, LocalVariableTable, MethodCode, MethodException, SourceFile, Synthetic, Unknown

public abstract class Attribute
extends Object

This class represents an attribute of the code attribute which is an attribute of the code attribute

Author:
Ben Litchfield

Field Summary
protected  long nameIndex
           
protected  ConstantPool pool
           
 
Constructor Summary
Attribute(ConstantPool p, long n)
          Constructor
 
Method Summary
 String getName()
          This will get the name of this attribute.
abstract  void load(DataInputStream in)
          This will load in the data for the attribute
abstract  byte[] toBytes()
          This will take this attribute and convert it into an array of bytes that can be stored in a classfile.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nameIndex

protected long nameIndex

pool

protected ConstantPool pool
Constructor Detail

Attribute

public Attribute(ConstantPool p,
                 long n)
Constructor

Method Detail

load

public abstract void load(DataInputStream in)
This will load in the data for the attribute


toBytes

public abstract byte[] toBytes()
This will take this attribute and convert it into an array of bytes that can be stored in a classfile.

Returns:
array of bytes representing this attribute

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
This will get the name of this attribute.

Returns:
The name of this attribute.