public final class Code extends Attribute
Attribute,
CodeException,
LineNumberTable,
LocalVariableTable,
Serialized Formconstant_pool, length, name_index, tag| 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(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(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) |
String |
toString() |
String |
toString(boolean verbose) |
addAttributeReader, clone, getConstantPool, getLength, getNameIndex, getTag, readAttribute, removeAttributeReader, setConstantPool, setLength, setNameIndexpublic 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(DataOutputStream file) throws IOException
dump in class Attributefile - Output file streamIOExceptionpublic 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 String toString(boolean verbose)
public final String toString()
public Attribute copy(ConstantPool constant_pool)
Copyright © 2018–2021 mhoffrogge. All rights reserved.