|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CodeAttribute
The Code
class represents a Code Attribute as defined by the JVM Class file
Specification: The Code attribute is a variable-length attribute used in the attributes table of
method_info structures. A Code attribute contains the Java virtual machine instructions and
auxiliary information for a single method, instance initialization method or class or interface
initialization method. Every Java virtual machine implementation must recognize Code attributes.
If the method is either native or abstract, its method_info structure must not have a Code
attribute. Otherwise, its method_info structure must have exactly one Code attribute.
Method Summary | |
---|---|
java.util.List<Instruction> |
generateObjectiveCode(int[] bytecode)
This private method generates an object oriented representation of the bytecode contained within this method. |
int |
getAttributeCount()
Gets the number of attributes of the current Code attribute. |
java.util.List<Attribute> |
getAttributes()
Gets the set of attributes associated with the current Code attribute. |
int[] |
getCode()
This method gets this Code Attribute's bytecode, as an int array. |
int |
getCodeLength()
Gets the numeber of bytes making up this method's actual code. |
java.util.List<ExceptionTableEntry> |
getExceptionTable()
Gets the exception table. |
int |
getExceptionTableLength()
Gets the number of entries in stored within the Exceptio Table |
int |
getMaxLocals()
Gets the number of local variables allocated upon method invocation. |
int |
getMaxStack()
Gets the maximum depth of this method's operand stack during execution. |
java.util.List<Instruction> |
getObjectiveCode()
This method returns the object oriented representation of this method's code. |
void |
setCode(int[] code)
This method sets this Code Attribute's bytecode, as an int array. |
void |
setMaxLocals(int maxLocals)
Sets the number of local variables allocated upon method invocation. |
void |
setMaxStack(int maxStack)
Sets the maximum depth of this method's operand stack during execution. |
void |
validateRefIntoCode(int ref)
Test whether the ref index refers to a valid opcode within the code array or
not. |
Methods inherited from interface jef.dna.attributes.Attribute |
---|
clone, fromStream, getDna, getLength, getNameIndex, setDna, setNameIndex, toStream, updateRefs, validate |
Methods inherited from interface jef.dna.util.BytesCountable |
---|
getBytesCount |
Method Detail |
---|
void setMaxStack(int maxStack)
maxStack
- Stack maximum depthint getMaxStack()
void setMaxLocals(int maxLocals)
maxLocals
- Number of allocated local variablesint getMaxLocals()
int getCodeLength()
int getExceptionTableLength()
Exceptio Table
java.util.List<ExceptionTableEntry> getExceptionTable()
Listctor
instance, containing
ExceptionTableEntry
instances.
List
of int getAttributeCount()
Code
attribute.
java.util.List<Attribute> getAttributes()
Code
attribute. This
set is represented by a List
holding instances of subclasses of the
GenericAttribute
base class.
java.util.List<Instruction> getObjectiveCode()
generateObjectiveCode
method.java.util.List<Instruction> generateObjectiveCode(int[] bytecode)
bytecode
- The method's bytecode
void setCode(int[] code)
int
array.
code
- The code as int
arrayint[] getCode()
int
array.
int
arrayvoid validateRefIntoCode(int ref) throws UnknownOpCodeException, MissingDnaContainerException, java.lang.IndexOutOfBoundsException
ref
index refers to a valid opcode within the code array or
not.
ref
- An index into the code array
UnknownOpCodeException
- One of the instructions of the current attribute is not recognized
MissingDnaContainerException
- There is no reference to the Dna
instance this attribute belongs
to
java.lang.IndexOutOfBoundsException
- Error during processing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |