|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JCodeAttribute
A JCodeAttribute object represents an Code attribute.
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.
For a given method, a Code attribute describes :
| Field Summary |
|---|
| Fields inherited from interface fr.umlv.corosol.classfile.attribute.JAttribute |
|---|
CODE, CONSTANT_VALUE, DEPRECATED, EXCEPTIONS, INNER_CLASSES, LINE_NUMBER_TABLE, LOCAL_VARIABLE_TABLE, SOURCE_FILE, SYNTHETIC |
| Method Summary | |
|---|---|
void |
addBytecode(int opcode)
Adds the specified byte code to the byte code handled by this Code attribute. |
void |
addBytecodes(byte[] b,
int off,
int len)
Adds len bytes from the specified byte array starting at offset off to the byte code handled by this Code attribute. |
void |
addByteOpBytecode(int opcode,
int operand)
Adds the specified byte code and its byte operand to the byte code handled by this Code attribute. |
void |
addClassOpBytecode(int opcode,
java.lang.String className)
Adds the specified byte code and its short operand determined by the name of a class. |
void |
addFieldOpBytecode(int opcode,
java.lang.String className,
java.lang.String name,
java.lang.String desc)
Adds the specified byte code and its short operand determined by the declaring class, the name and the descriptor of a field. |
void |
addIntOpBytecode(int opcode,
int operand)
Adds the specified byte code and its int operand to the byte code handled by this Code attribute. |
void |
addInvokeinterface(java.lang.String className,
java.lang.String name,
java.lang.String desc)
Adds the invokeinterface byte code and its short operand determined by the declaring class, the name and the descriptor of an interface method. |
void |
addMethodOpBytecode(int opcode,
java.lang.String className,
java.lang.String name,
java.lang.String desc)
Adds the specified byte code and its short operand determined by the declaring class, the name and the descriptor of a method. |
void |
addShortOpBytecode(int opcode,
int operand)
Adds the specified byte code and its short operand to the byte code handled by this Code attribute. |
JAttribute[] |
getAttributes()
Returns an array of optional attributes associated with this Code attribute. |
byte[] |
getByteCode()
Returns the bytecode of a method. |
JExceptionHandler[] |
getExceptionHandlers()
Returns an array containg the exception handlers in the byte code array of a method. |
int |
getMaxLocals()
Returns the number of local variables in the local variable array allocated upon invocation of a method, including the local variables used to pass parameters to this method on its invocation. |
int |
getMaxStack()
Returns the maximum depth of the operand stack at any point during execution of a method. |
void |
setAttributes(JAttribute[] attributes)
Sets the optional attributes associated with this Code attribute. |
void |
setByteCode(byte[] byteCode)
Sets the bytecode of a method whith the specified byte array. |
void |
setExceptionHandlers(JExceptionHandler[] handlers)
Sets the exception handlers in the byte code of a method. |
void |
setMaxLocals(int maxLocals)
Sets the number of local variables in the local variable array allocated upon invocation of a method, including the local variables used to pass parameters to this method on its invocation. |
void |
setMaxStack(int maxStack)
Sets the maximum depth of the operand stack at any point during execution of a method. |
| Methods inherited from interface fr.umlv.corosol.classfile.attribute.JAttribute |
|---|
getName, getSize, toString |
| Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem |
|---|
getConstantPool, readItem, setConstantPool, writeItem |
| Method Detail |
|---|
int getMaxStack()
int getMaxLocals()
byte[] getByteCode()
JExceptionHandler[] getExceptionHandlers()
JAttribute[] getAttributes()
void setMaxStack(int maxStack)
maxStack - the max size of the operand stack of a framevoid setMaxLocals(int maxLocals)
maxLocals - the max size of the local variable array of a framevoid setByteCode(byte[] byteCode)
byteCode - the bytecode of a methodvoid setExceptionHandlers(JExceptionHandler[] handlers)
handlers - the exception handlers of the byte code of a methodvoid setAttributes(JAttribute[] attributes)
attributes - an array of optional attributesvoid addBytecode(int opcode)
opcode - the opcode of a byte code instruction
void addByteOpBytecode(int opcode,
int operand)
opcode - the opcode of a byte code instructionoperand - the byte operand of the instruction
void addShortOpBytecode(int opcode,
int operand)
opcode - the opcode of a byte code instructionoperand - the short operand of the instruction
void addIntOpBytecode(int opcode,
int operand)
opcode - the opcode of a byte code instructionoperand - the int operand of the instruction
void addBytecodes(byte[] b,
int off,
int len)
b - the byte code data.off - the start offset in the data.len - the number of bytes to write.
void addClassOpBytecode(int opcode,
java.lang.String className)
opcode - the opcode of a byte code instructionclassName - the name of a class
void addMethodOpBytecode(int opcode,
java.lang.String className,
java.lang.String name,
java.lang.String desc)
opcode - the opcode of a byte code instructionclassName - the declaring class of a methodname - the name of a methoddesc - the name of a method
void addInvokeinterface(java.lang.String className,
java.lang.String name,
java.lang.String desc)
className - the declaring class of an interface methodname - the name of an interface methoddesc - the name of an interface method
void addFieldOpBytecode(int opcode,
java.lang.String className,
java.lang.String name,
java.lang.String desc)
opcode - the opcode of a byte code instructionclassName - the declaring class of a fieldname - the name of a fielddesc - the name of a field
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||