Code_attribute {
u2 attribute_name_index;
u4 attribute_length;
u2 max_stack;
u2 max_locals;
u4 code_length;
u1 code[code_length];
u2 exception_table_length;
{
u2 start_pc;
u2 end_pc;
u2 handler_pc;
u2 catch_type;
} exception_table[exception_table_length];
u2 attributes_count;
attribute_info attributes[attributes_count];
}
Attribute, CodeException, LineNumberTable, LocalVariableTable
| Modifier and Type | Field and Description |
|---|---|
| private Attribute[] | |
| private byte[] | |
| private CodeException[] | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | Code(final int
Index pointing to the name Code nameIndex, final int Content length in bytes length, final DataInput Input stream file, final ConstantPool Array of constants constantPool)
|
| public | Code(final int
Index pointing to the name Code nameIndex, final int Content length in bytes length, final int Maximum size of stack maxStack, final int Number of local variables maxLocals, final byte[] Actual byte code code, final CodeException[] of handled exceptions exceptionTable, final Attribute[] Attributes of code: LineNumber or LocalVariable attributes, final ConstantPool Array of constants constantPool)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(final Visitor
Visitor object v)Implements abstract com. Implements com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. |
| private int | calculateLength()
Returns: the full size of this code attribute, minus its first 6 bytes, including the size of all its contained attributes |
| public Attribute | copy(final ConstantPool
the constant pool to duplicate constantPool)Implements abstract com. Returns: deep copy of this attribute |
| public void | dump(final DataOutputStream
Output file stream file)Overrides com. Dump code attribute to file stream in binary format. |
| public Attribute[] | |
| public byte[] | |
| public CodeException[] | |
| private int | getInternalLength()
Returns: the internal length of this code attribute (minus the first 6 bytes) and excluding all its attributes |
| public LineNumberTable | |
| public LocalVariableTable | |
| public LocalVariableTypeTable | Returns: LocalVariableTypeTable of Code, if it has one, null otherwise.Gets the local variable type table attribute |
| public int | |
| public int | |
| public StackMap | Returns: StackMap of Code, if it has one, else null.Finds the attribute of |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | Returns: String representation of code chunk.Overrides com. Returns a string representation of the object. |
| public String | Returns: String representation of code chunk.Provides verbose output when true. verbose)Converts this object to a String. |
| attributes | back to summary |
|---|---|
| private Attribute[] attributes | |
| code | back to summary |
|---|---|
| private byte[] code | |
| exceptionTable | back to summary |
|---|---|
| private CodeException[] exceptionTable | |
| maxLocals | back to summary |
|---|---|
| private int maxLocals | |
| maxStack | back to summary |
|---|---|
| private int maxStack | |
| Code | back to summary |
|---|---|
| public Code(final Code code) Initialize from another object. Note that both objects use the same references (shallow copy). Use copy() for a physical copy.
| |
| Code | back to summary |
|---|---|
pack-priv Code(final int nameIndex, final int length, final DataInput file, final ConstantPool constantPool) throws IOException
| |
| Code | back to summary |
|---|---|
public Code(final int nameIndex, final int length, final int maxStack, final int maxLocals, final byte[] code, final CodeException[] exceptionTable, final Attribute[] attributes, final ConstantPool constantPool)
| |
| accept | back to summary |
|---|---|
| public void accept(final Visitor v) Implements abstract com. Implements com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. | |
| calculateLength | back to summary |
|---|---|
private int calculateLength()
| |
| copy | back to summary |
|---|---|
| public Attribute copy(final ConstantPool constantPool) Implements abstract com.
| |
| dump | back to summary |
|---|---|
| public void dump(final DataOutputStream file) throws IOException Overrides com. Dump code attribute to file stream in binary format.
| |
| getAttributes | back to summary |
|---|---|
| public Attribute[] getAttributes() | |
| getCode | back to summary |
|---|---|
public byte[] getCode()
| |
| getExceptionTable | back to summary |
|---|---|
public CodeException[] getExceptionTable()
| |
| getInternalLength | back to summary |
|---|---|
private int getInternalLength()
| |
| getLineNumberTable | back to summary |
|---|---|
public LineNumberTable getLineNumberTable()
| |
| getLocalVariableTable | back to summary |
|---|---|
public LocalVariableTable getLocalVariableTable()
| |
| getLocalVariableTypeTable | back to summary |
|---|---|
| public LocalVariableTypeTable getLocalVariableTypeTable() Gets the local variable type table attribute
| |
| getMaxLocals | back to summary |
|---|---|
public int getMaxLocals()
| |
| getMaxStack | back to summary |
|---|---|
public int getMaxStack()
| |
| getStackMap | back to summary |
|---|---|
| public StackMap getStackMap() Finds the attribute of
| |
| setAttributes | back to summary |
|---|---|
public void setAttributes(final Attribute[] attributes)
| |
| setCode | back to summary |
|---|---|
public void setCode(final byte[] code)
| |
| setExceptionTable | back to summary |
|---|---|
public void setExceptionTable(final CodeException[] exceptionTable)
| |
| setMaxLocals | back to summary |
|---|---|
public void setMaxLocals(final int maxLocals)
| |
| setMaxStack | back to summary |
|---|---|
public void setMaxStack(final int maxStack)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toString | back to summary |
|---|---|
| public String toString(final boolean verbose) Converts this object to a String.
| |