alt.jiapi.file.attribute
Class Attribute

java.lang.Object
  extended by alt.jiapi.file.attribute.Attribute
Direct Known Subclasses:
AnnotationBase, CodeAttribute, ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute, ExceptionsAttribute, InnerClassesAttribute, LineNumberTableAttribute, LocalVariableTableAttribute, LocalVariableTypeTableAttribute, SignatureAttribute, SourceDebugExtension, SourceFileAttribute, StackMapTableAttribute, SyntheticAttribute

public class Attribute
extends java.lang.Object

Base class of for attributes in class file. This class holds bytes of the attribute. Complex attributes, like Code attribute will override getBytes() method to support classfile manipulation.

Author:
Mika Riekkinen

Field Summary
protected  ConstantPool cp
           
 
Constructor Summary
protected Attribute(short nameIndex)
           
protected Attribute(short nameIndex, int length, java.io.DataInputStream dis)
           
 
Method Summary
 short getAttributeNameIndex()
           
 byte[] getBytes()
          Get the bytes of this attribute.
protected  java.io.DataInputStream getDataInputStream()
          Gets a DatainputStream that reads internal byte[]
 java.lang.String getName()
          Get the name of this Attribute
static Attribute readAttribute(ConstantPool constantPool, java.io.DataInputStream dis)
          Factory method for creating Attributes from given DataInputStream.
 void setConstantPool(ConstantPool cp)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cp

protected ConstantPool cp
Constructor Detail

Attribute

protected Attribute(short nameIndex)

Attribute

protected Attribute(short nameIndex,
                    int length,
                    java.io.DataInputStream dis)
             throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getAttributeNameIndex

public short getAttributeNameIndex()

getBytes

public byte[] getBytes()
Get the bytes of this attribute.

Returns:
bytes representing this Attribute.

getDataInputStream

protected java.io.DataInputStream getDataInputStream()
Gets a DatainputStream that reads internal byte[]

Returns:
DataInputStream

getName

public java.lang.String getName()
Get the name of this Attribute

Returns:
name of this attribute

readAttribute

public static Attribute readAttribute(ConstantPool constantPool,
                                      java.io.DataInputStream dis)
                               throws java.io.IOException
Factory method for creating Attributes from given DataInputStream.

Parameters:
constantPool -
dis -
Returns:
Throws:
java.io.IOException

setConstantPool

public void setConstantPool(ConstantPool cp)

toString

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


Copyright © 2001. Documenation generated August 26 2011.