This class represents a chunk of Java byte code contained in a
method. It is instantiated by the
Attribute.readAttribute() method. A Code
attribute contains informations about operand stack, local
variables, byte code and the exceptions handled within this
method.
This attribute has attributes itself, namely LineNumberTable which
is used for debugging purposes and LocalVariableTable which
contains information about the local variables.
Initialize from another object. Note that both objects use the same
references (shallow copy). Use copy() for a physical copy.
Code
public Code(int name_index,
int length,
int max_stack,
int max_locals,
byte[] code,
CodeException[] exception_table,
Attribute[] attributes,
ConstantPool constant_pool)
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
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. I.e., the hierarchy of methods,
fields, attributes, etc. spawns a tree of objects.