org.apache.bcel.classfile
public final class Code extends Attribute
Version: $Id: Code.java 386056 2006-03-15 11:31:56Z tcurdt $
See Also: Attribute CodeException LineNumberTable LocalVariableTable
| Field Summary | |
|---|---|
| Attribute[] | attributes |
| int | attributes_count |
| byte[] | code |
| int | code_length |
| CodeException[] | exception_table |
| int | exception_table_length |
| int | max_locals |
| int | max_stack |
| Constructor Summary | |
|---|---|
| Code(Code c)
Initialize from another object. | |
| Code(int name_index, int length, DataInputStream file, ConstantPool constant_pool) | |
| Code(int name_index, int length, int max_stack, int max_locals, byte[] code, CodeException[] exception_table, Attribute[] attributes, ConstantPool constant_pool) | |
| Method Summary | |
|---|---|
| void | accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. |
| int | calculateLength() |
| Attribute | copy(ConstantPool _constant_pool) |
| void | dump(DataOutputStream file)
Dump code attribute to file stream in binary format.
|
| Attribute[] | getAttributes() |
| byte[] | getCode() |
| CodeException[] | getExceptionTable() |
| int | getInternalLength() |
| 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(boolean verbose) |
| String | toString() |
Parameters: name_index Index pointing to the name Code length Content length in bytes file Input stream constant_pool Array of constants
Parameters: name_index Index pointing to the name Code length Content length in bytes max_stack Maximum size of stack max_locals Number of local variables code Actual byte code exception_table Table of handled exceptions attributes Attributes of code: LineNumber or LocalVariable constant_pool Array of constants
Parameters: v Visitor object
Returns: the full size of this code attribute, minus its first 6 bytes, including the size of all its contained attributes
Parameters: _constant_pool the constant pool to duplicate
Returns: deep copy of this attribute
Parameters: file Output file stream
Throws: IOException
Returns: Collection of code attributes.
See Also: Attribute
Returns: Actual byte code of the method.
Returns: Table of handled exceptions.
See Also: CodeException
Returns: the internal length of this code attribute (minus the first 6 bytes) and excluding all its attributes
Returns: LineNumberTable of Code, if it has one
Returns: LocalVariableTable of Code, if it has one
Returns: Number of local variables.
Returns: Maximum size of stack used by this method.
Parameters: attributes the attributes to set for this Code
Parameters: code byte code
Parameters: exception_table exception table
Parameters: max_locals maximum number of local variables
Parameters: max_stack maximum stack size
Returns: String representation of code chunk.
Returns: String representation of code chunk.