public class Code extends Attribute
| Modifier and Type | Class and Description |
|---|---|
class |
Code.ExceptionTableEntry
ExceptionTableEntry.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_NAME |
| Constructor and Description |
|---|
Code(ConstantPool cp,
short max_stack,
short max_locals)
Constructor for an empty CodeAttribute.
|
| Modifier and Type | Method and Description |
|---|---|
Attribute |
getAttribute(String name)
Gets a named attribute.
|
List<Attribute> |
getAttributes()
Gets all the attributes defined in this CodeAttribute.
|
byte[] |
getByteCode()
Gets the bytecode array of this CodeAttribute
|
byte[] |
getBytes()
Get the bytes of this attribute.
|
List<Code.ExceptionTableEntry> |
getExceptionTable()
Get the exception table.
|
LineNumberTable |
getLineNumberTable()
Gets the LineNumberTable attribute of this CodeAttribute, if it exists.
|
LocalVariableTable |
getLocalVariableTable()
Gets the LocalVariableTable attribute of this CodeAttribute, if it exists.
|
LocalVariableTypeTable |
getLocalVariableTypeTable()
Gets the LocalVariableTypeTable attribute of this CodeAttribute, if it exists.
|
short |
getMaxLocals()
Get max_locals.
|
short |
getMaxStack()
Get the max_stack.
|
StackMapTable |
getStackMapTable()
Gets the StackMapTable attribute.
|
void |
setByteCode(byte[] byteCode)
Sets the bytecode array of this CodeAttribute.
|
void |
setMaxLocals(short maxLocals)
Sets the max_locals.
|
void |
setMaxStack(short maxStack)
Sets the max_stack.
|
getAttributeNameIndex, getDataInputStream, getName, readAttribute, setConstantPool, toStringpublic static final String ATTRIBUTE_NAME
public Code(ConstantPool cp, short max_stack, short max_locals)
cp - ConstantPoolmax_stack - Max stackmax_locals - Max localspublic short getMaxStack()
public void setMaxStack(short maxStack)
maxStack - max_stackpublic short getMaxLocals()
public void setMaxLocals(short maxLocals)
maxLocals - Max localspublic byte[] getByteCode()
public void setByteCode(byte[] byteCode)
byteCode - bytespublic byte[] getBytes()
Attributepublic List<Attribute> getAttributes()
public Attribute getAttribute(String name)
name - Name of the attributepublic List<Code.ExceptionTableEntry> getExceptionTable()
public StackMapTable getStackMapTable()
public LineNumberTable getLineNumberTable()
public LocalVariableTable getLocalVariableTable()
public LocalVariableTypeTable getLocalVariableTypeTable()
Copyright © 2017. All rights reserved.