public final class Code extends Attribute
Attribute,
CodeException,
LineNumberTable,
LocalVariableTableconstant_pool, EMPTY_ARRAY, length, name_index, tag| Constructor and Description |
|---|
Code(Code c)
Initialize from another object.
|
Code(int nameIndex,
int length,
int maxStack,
int maxLocals,
byte[] code,
CodeException[] exceptionTable,
Attribute[] attributes,
ConstantPool constantPool) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
|
Attribute |
copy(ConstantPool constantPool) |
void |
dump(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[] exceptionTable) |
void |
setMaxLocals(int maxLocals) |
void |
setMaxStack(int maxStack) |
String |
toString() |
String |
toString(boolean verbose) |
addAttributeReader, addAttributeReader, clone, getConstantPool, getLength, getName, getNameIndex, getTag, println, readAttribute, readAttribute, removeAttributeReader, setConstantPool, setLength, setNameIndexpublic Code(Code c)
public Code(int nameIndex, int length, int maxStack, int maxLocals, byte[] code, CodeException[] exceptionTable, Attribute[] attributes, ConstantPool constantPool)
nameIndex - Index pointing to the name Codelength - Content length in bytesmaxStack - Maximum size of stackmaxLocals - Number of local variablescode - Actual byte codeexceptionTable - of handled exceptionsattributes - Attributes of code: LineNumber or LocalVariableconstantPool - Array of constantspublic void accept(Visitor v)
public Attribute copy(ConstantPool constantPool)
public void dump(DataOutputStream file) throws IOException
dump in class Attributefile - Output file streamIOException - if an I/O error occurs.public Attribute[] getAttributes()
Attributepublic byte[] getCode()
public CodeException[] getExceptionTable()
CodeExceptionpublic LineNumberTable getLineNumberTable()
public LocalVariableTable getLocalVariableTable()
public int getMaxLocals()
public int getMaxStack()
public void setAttributes(Attribute[] attributes)
attributes - the attributes to set for this Codepublic void setCode(byte[] code)
code - byte codepublic void setExceptionTable(CodeException[] exceptionTable)
exceptionTable - exception tablepublic void setMaxLocals(int maxLocals)
maxLocals - maximum number of local variablespublic void setMaxStack(int maxStack)
maxStack - maximum stack sizeCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.