|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectclassUtils.javassist.bytecode.AttributeInfo
classUtils.javassist.bytecode.CodeAttribute
public class CodeAttribute
Code_attribute
.
To browse the code
field of
a Code_attribute
structure,
use CodeIterator
.
CodeIterator
Nested Class Summary | |
---|---|
static class |
CodeAttribute.RuntimeCopyException
An exception that may be thrown by copy()
in CodeAttribute . |
Field Summary | |
---|---|
static java.lang.String |
tag
The name of this attribute "Code" . |
Constructor Summary | |
---|---|
CodeAttribute(ConstPool cp,
int stack,
int locals,
byte[] code,
ExceptionTable etable)
Constructs a Code_attribute . |
Method Summary | |
---|---|
AttributeInfo |
copy(ConstPool newCp,
java.util.Map classnames)
Makes a copy. |
byte[] |
get()
This method is not available. |
AttributeInfo |
getAttribute(java.lang.String name)
Returns the attribute with the specified name. |
java.util.List |
getAttributes()
Returns attributes[] . |
byte[] |
getCode()
Returns code[] . |
int |
getCodeLength()
Returns code_length . |
java.lang.String |
getDeclaringClass()
Returns the name of the class declaring the method including this code attribute. |
ExceptionTable |
getExceptionTable()
Returns exception_table[] . |
int |
getMaxLocals()
Returns max_locals . |
int |
getMaxStack()
Returns max_stack . |
CodeIterator |
iterator()
Makes a new iterator for reading this code attribute. |
int |
length()
Returns the length of this attribute_info
structure. |
void |
set(byte[] newinfo)
This method is not available. |
void |
setMaxLocals(int value)
Sets max_locals . |
void |
setMaxStack(int value)
Sets max_stack . |
Methods inherited from class classUtils.javassist.bytecode.AttributeInfo |
---|
getConstPool, getName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String tag
"Code"
.
Constructor Detail |
---|
public CodeAttribute(ConstPool cp, int stack, int locals, byte[] code, ExceptionTable etable)
Code_attribute
.
cp
- constant pool tablestack
- max_stack
locals
- max_locals
code
- code[]
etable
- exception_table[]
Method Detail |
---|
public AttributeInfo copy(ConstPool newCp, java.util.Map classnames) throws CodeAttribute.RuntimeCopyException
Map
object.
copy
in class AttributeInfo
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted
class names.
CodeAttribute
object.
CodeAttribute.RuntimeCopyException
- if a BadBytecode
exception is thrown, it is
converted into
RuntimeCopyException
.public int length()
attribute_info
structure.
The returned value is attribute_length + 6
.
length
in class AttributeInfo
public byte[] get()
get
in class AttributeInfo
java.lang.UnsupportedOperationException
- always thrown.public void set(byte[] newinfo)
set
in class AttributeInfo
java.lang.UnsupportedOperationException
- always thrown.public java.lang.String getDeclaringClass()
public int getMaxStack()
max_stack
.
public void setMaxStack(int value)
max_stack
.
public int getMaxLocals()
max_locals
.
public void setMaxLocals(int value)
max_locals
.
public int getCodeLength()
code_length
.
public byte[] getCode()
code[]
.
public CodeIterator iterator()
public ExceptionTable getExceptionTable()
exception_table[]
.
public java.util.List getAttributes()
attributes[]
.
It returns a list of AttributeInfo
.
AttributeInfo
public AttributeInfo getAttribute(java.lang.String name)
name
- attribute name
AttributeInfo
object or null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |