| java.lang.Object javassist.bytecode.AttributeInfo javassist.bytecode.CodeAttribute
CodeAttribute | public class CodeAttribute extends AttributeInfo implements Opcode(Code) | | Code_attribute .
To browse the code field of
a Code_attribute structure,
use CodeIterator .
See Also: CodeIterator |
Field Summary | |
final public static String | tag The name of this attribute "Code" . |
tag | final public static String tag(Code) | | The name of this attribute "Code" .
|
CodeAttribute | public CodeAttribute(ConstPool cp, int stack, int locals, byte[] code, ExceptionTable etable)(Code) | | Constructs a Code_attribute .
Parameters: cp - constant pool table Parameters: stack - max_stack Parameters: locals - max_locals Parameters: code - code[] Parameters: etable - exception_table[] |
computeMaxStack | public int computeMaxStack() throws BadBytecode(Code) | | Computes the maximum stack size and sets max_stack
to the computed size.
throws: BadBytecode - if this method fails in computing. the newly computed value of max_stack |
copy | public AttributeInfo copy(ConstPool newCp, Map classnames) throws RuntimeCopyException(Code) | | Makes a copy. Class names are replaced according to the
given Map object.
Parameters: newCp - the constant pool table used by the new copy. Parameters: classnames - pairs of replaced and substitutedclass names. exception: RuntimeCopyException - if a BadBytecode exception is thrown, it isconverted intoRuntimeCopyException . CodeAttribute object. |
getAttribute | public AttributeInfo getAttribute(String name)(Code) | | Returns the attribute with the specified name.
If it is not found, this method returns null.
Parameters: name - attribute name an AttributeInfo object or null. |
getAttributes | public List getAttributes()(Code) | | Returns attributes[] .
It returns a list of AttributeInfo .
A new element can be added to the returned list
and an existing element can be removed from the list.
See Also: AttributeInfo |
getCode | public byte[] getCode()(Code) | | Returns code[] .
|
getCodeLength | public int getCodeLength()(Code) | | Returns code_length .
|
getDeclaringClass | public String getDeclaringClass()(Code) | | Returns the name of the class declaring the method including
this code attribute.
|
getMaxLocals | public int getMaxLocals()(Code) | | Returns max_locals .
|
getMaxStack | public int getMaxStack()(Code) | | Returns max_stack .
|
iterator | public CodeIterator iterator()(Code) | | Makes a new iterator for reading this code attribute.
|
length | public int length()(Code) | | Returns the length of this attribute_info
structure.
The returned value is attribute_length + 6 .
|
setCode | void setCode(byte[] newinfo)(Code) | | Sets code[] .
|
setMaxLocals | public void setMaxLocals(int value)(Code) | | Sets max_locals .
|
setMaxStack | public void setMaxStack(int value)(Code) | | Sets max_stack .
|
|
|