Code_attribute.
To browse the code field of
a Code_attribute structure,
use CodeIterator.
CodeIterator, iterator()
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| public static class | CodeAttribute.
An exception that may be thrown by |
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private ExceptionTable | |
| private int | |
| private int | |
| public static final String | tag
The name of this attribute |
| Access | Constructor and Description |
|---|---|
| public | CodeAttribute(ConstPool
constant pool table cp, int max_stackmax_localscode[]exception_table[]Constructs a |
| private | CodeAttribute(ConstPool
constant pool table. cp, CodeAttribute source Code attribute. src, Map<String, String> pairs of replaced and substituted
class names. classnames)Constructs a copy of |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the newly computed value ofmax_stackComputes the maximum stack size and sets |
| public AttributeInfo | |
| private byte[] | copyCode(ConstPool destCp, Map<String, String> classnames, ExceptionTable etable, CodeAttribute destCa)
Copies code. |
| private static CodeAttribute. | |
| private static void | |
| public byte[] | |
| public AttributeInfo | Returns: anAttributeInfo object or null.attribute name name)Returns the attribute with the specified name. |
| public List | |
| public byte[] | |
| public int | |
| public String | getDeclaringClass()
Returns the name of the class declaring the method including this code attribute. |
| public ExceptionTable | |
| public int | |
| public int | |
| pack-priv void | getRefClasses(Map<String, String> classnames)
Overrides javassist.
|
| public void | insertLocalVar(int
the index of the new parameter. where, int the type size of the new parameter (1 or 2). size)Changes the index numbers of the local variables to append a new parameter. |
| public CodeIterator | |
| public int | length()
Overrides javassist. Returns the length of this |
| pack-priv void | |
| pack-priv void | |
| public void | |
| public void | setAttribute(StackMapTable
the stack map table added to this code attribute.
If it is null, a new stack map is not added.
Only the old stack map is removed. smt)Adds a stack map table. |
| public void | setAttribute(StackMap
the stack map table added to this code attribute.
If it is null, a new stack map is not added.
Only the old stack map is removed. sm)Adds a stack map table for J2ME (CLDC). |
| pack-priv void | |
| public void | |
| public void | |
| private static void | shiftIndex(CodeIterator ci, int
If the index of the local variable is
less than this value, it does not change.
Otherwise, the index is increased. lessThan, int the indexes of the local variables are
increased by this value. delta)
|
| private static void | shiftIndex0(CodeIterator ci, int index, int opcode, int lessThan, int delta, int opcode_i_0, int opcode_i)
|
| private static void | |
| pack-priv void |
| attributes | back to summary |
|---|---|
| private List<AttributeInfo> attributes | |
| exceptions | back to summary |
|---|---|
| private ExceptionTable exceptions | |
| maxLocals | back to summary |
|---|---|
| private int maxLocals | |
| maxStack | back to summary |
|---|---|
| private int maxStack | |
| tag | back to summary |
|---|---|
| public static final String tag The name of this attribute | |
| CodeAttribute | back to summary |
|---|---|
| public CodeAttribute(ConstPool cp, int stack, int locals, byte[] code, ExceptionTable etable) Constructs a
| |
| CodeAttribute | back to summary |
|---|---|
| private CodeAttribute(ConstPool cp, CodeAttribute src, Map<String, String> classnames) throws BadBytecode Constructs a copy of
| |
| CodeAttribute | back to summary |
|---|---|
| pack-priv CodeAttribute(ConstPool cp, int name_id, DataInputStream in) throws IOException | |
| computeMaxStack | back to summary |
|---|---|
| public int computeMaxStack() throws BadBytecode Computes the maximum stack size and sets
| |
| copy | back to summary |
|---|---|
| public AttributeInfo copy(ConstPool newCp, Map<String, String> classnames) throws RuntimeCopyException Overrides javassist. Makes a copy. Class names are replaced according to the
given
| |
| copyCode | back to summary |
|---|---|
| private byte[] copyCode(ConstPool destCp, Map<String, String> classnames, ExceptionTable etable, CodeAttribute destCa) throws BadBytecode Copies code. | |
| copyCode | back to summary |
|---|---|
| private static CodeAttribute. | |
| copyConstPoolInfo | back to summary |
|---|---|
| private static void copyConstPoolInfo(int i, byte[] code, ConstPool srcCp, byte[] newcode, ConstPool destCp, Map<String, String> classnameMap) | |
| get | back to summary |
|---|---|
| public byte[] get() Overrides javassist. This method is not available.
| |
| getAttribute | back to summary |
|---|---|
| public AttributeInfo getAttribute(String name) Returns the attribute with the specified name. If it is not found, this method returns null.
| |
| getAttributes | back to summary |
|---|---|
| public List Returns
| |
| getCode | back to summary |
|---|---|
| public byte[] getCode() Returns | |
| getCodeLength | back to summary |
|---|---|
| public int getCodeLength() Returns | |
| getDeclaringClass | back to summary |
|---|---|
| public String getDeclaringClass() Returns the name of the class declaring the method including this code attribute. | |
| getExceptionTable | back to summary |
|---|---|
| public ExceptionTable getExceptionTable() Returns | |
| getMaxLocals | back to summary |
|---|---|
| public int getMaxLocals() Returns | |
| getMaxStack | back to summary |
|---|---|
| public int getMaxStack() Returns | |
| getRefClasses | back to summary |
|---|---|
| pack-priv void getRefClasses(Map<String, String> classnames) Overrides javassist.
| |
| insertLocalVar | back to summary |
|---|---|
| public void insertLocalVar(int where, int size) throws BadBytecode Changes the index numbers of the local variables
to append a new parameter.
This method does not update
| |
| iterator | back to summary |
|---|---|
| public CodeIterator iterator() Makes a new iterator for reading this code attribute. | |
| length | back to summary |
|---|---|
| public int length() Overrides javassist. Returns the length of this
| |
| renameClass | back to summary |
|---|---|
| pack-priv void renameClass(String oldname, String newname) Overrides javassist.
| |
| renameClass | back to summary |
|---|---|
| pack-priv void renameClass(Map<String, String> classnames) Overrides javassist.
| |
| set | back to summary |
|---|---|
| public void set(byte[] newinfo) Overrides javassist. This method is not available.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(StackMapTable smt) Adds a stack map table. If another copy of stack map table is already contained, the old one is removed.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(StackMap sm) Adds a stack map table for J2ME (CLDC). If another copy of stack map table is already contained, the old one is removed.
| |
| setCode | back to summary |
|---|---|
| pack-priv void setCode(byte[] newinfo) Sets | |
| setMaxLocals | back to summary |
|---|---|
| public void setMaxLocals(int value) Sets | |
| setMaxStack | back to summary |
|---|---|
| public void setMaxStack(int value) Sets | |
| shiftIndex | back to summary |
|---|---|
private static void shiftIndex(CodeIterator ci, int lessThan, int delta) throws BadBytecode
| |
| shiftIndex0 | back to summary |
|---|---|
| private static void shiftIndex0(CodeIterator ci, int index, int opcode, int lessThan, int delta, int opcode_i_0, int opcode_i) throws BadBytecode | |
| shiftIndex8 | back to summary |
|---|---|
| private static void shiftIndex8(CodeIterator ci, int index, int opcode, int lessThan, int delta) throws BadBytecode | |
| write | back to summary |
|---|---|
| pack-priv void write(DataOutputStream out) throws IOException Overrides javassist.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv CodeAttribute. | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static byte[] |
| index | back to summary |
|---|---|
| pack-priv int index | |
| next | back to summary |
|---|---|
| pack-priv CodeAttribute. | |
| where | back to summary |
|---|---|
| pack-priv int where | |
| LdcEntry | back to summary |
|---|---|
| pack-priv LdcEntry() | |
| doit | back to summary |
|---|---|
| pack-priv static byte[] doit(byte[] code, CodeAttribute. | |
copy()
in CodeAttribute.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
default serialVersionUID
|
| Access | Constructor and Description |
|---|---|
| public |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. default serialVersionUID | |
| RuntimeCopyException | back to summary |
|---|---|
| public RuntimeCopyException(String s) Constructs an exception. | |