All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.ClassFile.Raw.Attribute.Attribute

java.lang.Object
   |
   +----harpoon.ClassFile.Raw.Attribute.Attribute

public abstract class Attribute
extends Object
Attributes are used in the ClassFile, field_info, method_info, and Code_attribute structures of the class file format. Attribute is the superclass of the different types of attribute information classes.

Version:
$Id: Attribute.java,v 1.13 1998/10/11 03:01:13 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
ClassFile, FieldInfo, MethodInfo, AttributeCode

Variable Index

 o attribute_name_index
The attribute_name_index must be a valid unsigned 16-bit index into the constant pool of the class.
 o parent
ClassFile in which this attribute information is found.

Constructor Index

 o Attribute(ClassFile, int)
Constructor.

Method Index

 o attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
 o attribute_name()
 o attribute_name_index()
 o print(PrintWriter, int)
Pretty-print this attribute structure.
 o read(ClassFile, ClassDataInputStream)
Read an Attribute from a ClassDataInputStream.
 o toString()
Create a human-readable representation for the Attribute.
 o write(ClassDataOutputStream)
Write Attribute to bytecode file.

Variables

 o parent
 protected ClassFile parent
ClassFile in which this attribute information is found.

 o attribute_name_index
 public int attribute_name_index
The attribute_name_index must be a valid unsigned 16-bit index into the constant pool of the class. The constant_pool entry at attribute_name_index must be a CONSTANT_Utf8 string representing the name of the attribute.

Constructors

 o Attribute
 protected Attribute(ClassFile p,
                     int attribute_name_index)
Constructor. Meant for use only by subclasses.

Methods

 o attribute_length
 public abstract long attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.

 o read
 public static Attribute read(ClassFile parent,
                              ClassDataInputStream in) throws IOException
Read an Attribute from a ClassDataInputStream.

 o write
 public abstract void write(ClassDataOutputStream out) throws IOException
Write Attribute to bytecode file.

 o attribute_name_index
 public ConstantUtf8 attribute_name_index()
 o attribute_name
 public String attribute_name()
 o toString
 public String toString()
Create a human-readable representation for the Attribute.

Overrides:
toString in class Object
 o print
 public void print(PrintWriter pw,
                   int indent)
Pretty-print this attribute structure.


All Packages  Class Hierarchy  This Package  Previous  Next  Index