public class Code extends Attribute
Catch,
GenericAttribute,
LineNumberDebugInfo,
LocalVariableTable| Constructor and Description |
|---|
Code(ClassInfo classInfo,
java.io.DataInputStream in,
int index,
int len)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
byte[] |
code()
Get the bytes of the code.
|
int |
codeLength()
Return the length of the code array
|
Catch[] |
exceptionHandlers()
Get the exception handlers in the method.
|
int |
length()
Get the length of the attribute.
|
LineNumberDebugInfo[] |
lineNumbers()
Get the line number debug info for the code.
|
LocalDebugInfo[] |
locals()
Get the local variable debug info for the code.
|
int |
maxLocals()
Get the maximum number of locals used by the code.
|
int |
maxStack()
Get the maximum height of the operand stack used by the code.
|
void |
setCode(byte[] code)
Set the bytes of the code.
|
void |
setExceptionHandlers(Catch[] handlers)
Set the exception handlers in the method.
|
void |
setLineNumbers(LineNumberDebugInfo[] lineNumbers)
Set the line number debug info for the code.
|
void |
setLocals(LocalDebugInfo[] locals)
Set the local variable debug info for the code.
|
void |
setMaxLocals(int maxLocals)
Set the maximum number of locals used by the code.
|
void |
setMaxStack(int maxStack)
Set the maximum height of the operand stack used by the code.
|
java.lang.String |
toString()
Returns a string representation of the attribute.
|
void |
writeData(java.io.DataOutputStream out)
Write the attribute to a data stream.
|
public Code(ClassInfo classInfo, java.io.DataInputStream in, int index, int len) throws java.io.IOException
in - The data stream containing the class file.index - The index into the constant pool of the name of the attribute.len - The length of the attribute, excluding the header.java.io.IOException - If an error occurs while reading.public void writeData(java.io.DataOutputStream out)
throws java.io.IOException
public void setMaxStack(int maxStack)
maxStack - The maximum height of the stack.public void setMaxLocals(int maxLocals)
maxLocals - The maximum number of locals.public int maxStack()
public int maxLocals()
public void setExceptionHandlers(Catch[] handlers)
handlers - The handlers.public int length()
public LineNumberDebugInfo[] lineNumbers()
public LocalDebugInfo[] locals()
public void setLineNumbers(LineNumberDebugInfo[] lineNumbers)
lineNumbers - The line number debug info for the code.public void setLocals(LocalDebugInfo[] locals)
locals - The local variable debug info for the code.public Catch[] exceptionHandlers()
public byte[] code()
public int codeLength()
public void setCode(byte[] code)
code - The code.