|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.IR.RawClass.Attribute
public abstract class Attribute
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.
ClassFile
,
FieldInfo
,
MethodInfo
,
AttributeCode
Field Summary | |
---|---|
int |
attribute_name_index
The attribute_name_index must be a valid unsigned
16-bit index into the constant pool of the class. |
protected ClassFile |
parent
ClassFile in which this attribute information is found. |
Constructor Summary | |
---|---|
protected |
Attribute(ClassFile p,
int attribute_name_index)
Constructor. |
Method Summary | |
---|---|
abstract long |
attribute_length()
The value of the attribute_length item indicates
the length of the attribute, excluding the initial six bytes. |
ConstantUtf8 |
attribute_name_index()
|
String |
attribute_name()
|
void |
print(PrintWriter pw,
int indent)
Pretty-print this attribute structure. |
static Attribute |
read(ClassFile parent,
ClassDataInputStream in)
Read an Attribute from a ClassDataInputStream. |
String |
toString()
Create a human-readable representation for the Attribute. |
abstract void |
write(ClassDataOutputStream out)
Write Attribute to bytecode file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ClassFile parent
public int attribute_name_index
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.
Constructor Detail |
---|
protected Attribute(ClassFile p, int attribute_name_index)
Method Detail |
---|
public abstract long attribute_length()
attribute_length
item indicates
the length of the attribute, excluding the initial six bytes.
public static Attribute read(ClassFile parent, ClassDataInputStream in) throws IOException
IOException
public abstract void write(ClassDataOutputStream out) throws IOException
IOException
public ConstantUtf8 attribute_name_index()
public String attribute_name()
public String toString()
toString
in class Object
public void print(PrintWriter pw, int indent)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |