harpoon.IR.RawClass
Class AttributeSignature

java.lang.Object
  extended by harpoon.IR.RawClass.Attribute
      extended by harpoon.IR.RawClass.AttributeSignature

public class AttributeSignature
extends Attribute

Classfiles need to carry generic type information in a backwards-compatible way. This is accomplished by introducing a new "Signature" attribute for classes, methods, and fields. (GJ)

Version:
$Id: AttributeSignature.java,v 1.3 2003/09/05 21:45:16 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Attribute, ClassFile

Field Summary
static String ATTRIBUTE_NAME
          The string naming this Attribute type.
 int signature_index
          The value of the signature_index item must be a valid index into the constant_pool table.
 
Fields inherited from class harpoon.IR.RawClass.Attribute
attribute_name_index, parent
 
Constructor Summary
AttributeSignature(ClassFile parent, int attribute_name_index, int signature_index)
          Constructor.
 
Method Summary
 long attribute_length()
          The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
 void print(PrintWriter pw, int indent)
          Pretty-print this attribute structure.
 ConstantUtf8 signature_index()
           
 String signature()
           
 void write(ClassDataOutputStream out)
          Write to bytecode stream.
 
Methods inherited from class harpoon.IR.RawClass.Attribute
attribute_name_index, attribute_name, read, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_NAME

public static final String ATTRIBUTE_NAME
The string naming this Attribute type.

See Also:
Constant Field Values

signature_index

public int signature_index
The value of the signature_index item must be a valid index into the constant_pool table. The constant pool entry at that index must be a CONSTANT_Utf8_info structure representing the string giving the name of the GJ signature for this method, field, or class.

Constructor Detail

AttributeSignature

public AttributeSignature(ClassFile parent,
                          int attribute_name_index,
                          int signature_index)
Constructor.

Method Detail

attribute_length

public long attribute_length()
Description copied from class: Attribute
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.

Specified by:
attribute_length in class Attribute

signature_index

public ConstantUtf8 signature_index()

signature

public String signature()

write

public void write(ClassDataOutputStream out)
           throws IOException
Write to bytecode stream.

Specified by:
write in class Attribute
Throws:
IOException

print

public void print(PrintWriter pw,
                  int indent)
Pretty-print this attribute structure.

Overrides:
print in class Attribute
Parameters:
indent - the indentation level to use.