public final class Code extends Attribute
Attribute,
CodeException,
LineNumberTable,
LocalVariableTable,
Serialized Form| Constructor and Description |
|---|
Code(Code c)
Initialize from another object.
|
Code(int name_index,
int length,
int max_stack,
int max_locals,
byte[] code,
CodeException[] exception_table,
Attribute[] attributes,
ConstantPool constant_pool) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ClassVisitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
|
void |
dump(java.io.DataOutputStream file)
Dump code attribute to file stream in binary format.
|
Attribute[] |
getAttributes() |
byte[] |
getCode() |
java.lang.String |
getCodeString()
Returns the same as toString(true) except that the attribute information isn't included (line numbers).
|
CodeException[] |
getExceptionTable() |
LineNumberTable |
getLineNumberTable() |
LocalVariableTable |
getLocalVariableTable() |
int |
getMaxLocals() |
int |
getMaxStack() |
void |
setAttributes(Attribute[] attributes) |
void |
setCode(byte[] code) |
void |
setExceptionTable(CodeException[] exception_table) |
void |
setMaxLocals(int max_locals) |
void |
setMaxStack(int max_stack) |
java.lang.String |
toString() |
java.lang.String |
toString(boolean verbose) |
getConstantPool, getLength, getName, getNameIndex, getTag, readAttributepublic Code(Code c)
public Code(int name_index,
int length,
int max_stack,
int max_locals,
byte[] code,
CodeException[] exception_table,
Attribute[] attributes,
ConstantPool constant_pool)
name_index - Index pointing to the name Codelength - Content length in bytesmax_stack - Maximum size of stackmax_locals - Number of local variablescode - Actual byte codeexception_table - Table of handled exceptionsattributes - Attributes of code: LineNumber or LocalVariableconstant_pool - Array of constantspublic void accept(ClassVisitor v)
public final void dump(java.io.DataOutputStream file)
throws java.io.IOException
public final Attribute[] getAttributes()
Attributepublic LineNumberTable getLineNumberTable()
public LocalVariableTable getLocalVariableTable()
public final byte[] getCode()
public final CodeException[] getExceptionTable()
CodeExceptionpublic final int getMaxLocals()
public final int getMaxStack()
public final void setAttributes(Attribute[] attributes)
attributes. - public final void setCode(byte[] code)
code - byte codepublic final void setExceptionTable(CodeException[] exception_table)
exception_table - exception tablepublic final void setMaxLocals(int max_locals)
max_locals - maximum number of local variablespublic final void setMaxStack(int max_stack)
max_stack - maximum stack sizepublic final java.lang.String toString(boolean verbose)
public final java.lang.String toString()
public java.lang.String getCodeString()