koala.dynamicjava.classfile
Class CodeAttribute
java.lang.Object
|
+--koala.dynamicjava.classfile.BytecodeComponent
|
+--koala.dynamicjava.classfile.AttributeInfo
|
+--koala.dynamicjava.classfile.CodeAttribute
- public class CodeAttribute
- extends AttributeInfo
This class represents a method code attribute
Method Summary |
void |
addExceptionTableEntry(short spc,
short epc,
short tpc,
java.lang.String ex)
Adds an exception entry in the exception table |
void |
setCode(byte[] code,
short nl,
short ms)
Sets the code for this code attribute |
void |
write(java.io.DataOutputStream out)
Writes the code info to the given output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CodeAttribute
public CodeAttribute(ConstantPool cp)
- Creates a new empty (not valid) code attribute
- Parameters:
cp
- the constant pool
write
public void write(java.io.DataOutputStream out)
throws java.io.IOException
- Writes the code info to the given output stream.
- Overrides:
write
in class BytecodeComponent
setCode
public void setCode(byte[] code,
short nl,
short ms)
- Sets the code for this code attribute
- Parameters:
code
- the byte code arraynl
- the number of local variablesms
- the max stack size
addExceptionTableEntry
public void addExceptionTableEntry(short spc,
short epc,
short tpc,
java.lang.String ex)
- Adds an exception entry in the exception table
- Parameters:
spc
- the start of the try statementepc
- the end of the try statementtpc
- the handler positionex
- the name of the exception
Copyright © 2001 Stephane Hillion. All Rights Reserved.