java.io.Serializable
, java.lang.Cloneable
, Node
public final class Code extends Attribute
Attribute
,
CodeException
,
LineNumberTable
,
LocalVariableTable
,
Serialized Formconstant_pool, length, name_index, tag
Constructor | Description |
---|---|
Code(int name_index,
int length,
int max_stack,
int max_locals,
byte[] code,
CodeException[] exception_table,
Attribute[] attributes,
ConstantPool constant_pool) |
|
Code(Code c) |
Initialize from another object.
|
Modifier and Type | Method | Description |
---|---|---|
void |
accept(Visitor v) |
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class.
|
Attribute |
copy(ConstantPool _constant_pool) |
|
void |
dump(java.io.DataOutputStream file) |
Dump code attribute to file stream in binary format.
|
Attribute[] |
getAttributes() |
|
byte[] |
getCode() |
|
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) |
addAttributeReader, clone, getConstantPool, getLength, getNameIndex, getTag, readAttribute, removeAttributeReader, setConstantPool, setLength, setNameIndex
public 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(Visitor v)
public final void dump(java.io.DataOutputStream file) throws java.io.IOException
public final Attribute[] getAttributes()
Attribute
public LineNumberTable getLineNumberTable()
public LocalVariableTable getLocalVariableTable()
public final byte[] getCode()
public final CodeException[] getExceptionTable()
CodeException
public final int getMaxLocals()
public final int getMaxStack()
public final void setAttributes(Attribute[] attributes)
attributes
- the attributes to set for this Codepublic 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 Attribute copy(ConstantPool _constant_pool)