public final class Code extends Attribute
Attribute
,
CodeException
,
LineNumberTable
,
LocalVariableTable
constant_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, addAttributeReader, clone, getConstantPool, getLength, getName, getNameIndex, getTag, println, readAttribute, 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 void dump(DataOutputStream file) throws IOException
dump
in class Attribute
file
- Output file streamIOException
public Attribute[] getAttributes()
Attribute
public LineNumberTable getLineNumberTable()
public LocalVariableTable getLocalVariableTable()
public byte[] getCode()
public CodeException[] getExceptionTable()
CodeException
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[] exception_table)
exception_table
- exception tablepublic void setMaxLocals(int max_locals)
max_locals
- maximum number of local variablespublic void setMaxStack(int max_stack)
max_stack
- maximum stack sizepublic Attribute copy(ConstantPool _constant_pool)
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.