| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Template class for building up a method. This is done by defining exception handlers, adding thrown exceptions, local variables and attributes, whereas the `LocalVariableTable' attribute will be set automatically for the code. While generating code it may be necessary to insert NOP operations. You can use the `removeNOPs' method to get rid off them. The resulting method object can be obtained via the `getMethod()' method.
Constructor Summary | |
MethodGen(int access_flags, ClassGenType return_type, ClassGenType[] arg_types, String[] arg_names, String method_name, String class_name, InstructionList il, ConstantPoolGen cp) Declare method. |
Method Summary | |
void | addAttribute(Attribute attr) Add an attribute to this method. |
void | addException(String class_name) Add an exception thrown by this method. |
void | addExceptionHandler(InstructionHandle start_pc, InstructionHandle end_pc, InstructionHandle handler_pc, int catch_type) Add an exception handler, i.e. |
void | addExceptionHandler(InstructionHandle start_pc, InstructionHandle end_pc, InstructionHandle handler_pc, String catch_type) Add an exception handler, i.e. |
LocalVariableGen | addLocalVariable(String name, ClassGenType type, InstructionHandle start, InstructionHandle end) Add a local variable to this method. |
int | getAccessFlags() |
ClassGenType[] | getArgTypes() |
final Attribute[] | getAttributes() |
String | getClassName() |
final InstructionList | getInstructionList() |
final LocalVariableGen[] | getLocalVariables() |
Method | getMethod(int max_stack) Get method object. |
String | getMethodName() |
ClassGenType | getReturnType() |
LocalVariableGen | lookupLocal(String name) |
final void | removeNOPs() Remove all NOPs from the instruction list (if possible) and update every object refering to them, i.e. |
void | setAccessFlags(short access_flags) |
void | setArgTypes(ClassGenType[] arg_types) |
void | setMethodName(String method_name) |
void | setReturnType(ClassGenType return_type) |
Constructor Detail |
public MethodGen(int access_flags, ClassGenType return_type, ClassGenType[] arg_types, String[] arg_names, String method_name, String class_name, InstructionList il, ConstantPoolGen cp)
Method Detail |
public void addAttribute(Attribute attr)
public void addException(String class_name)
public void addExceptionHandler(InstructionHandle start_pc, InstructionHandle end_pc, InstructionHandle handler_pc, int catch_type)
public void addExceptionHandler(InstructionHandle start_pc, InstructionHandle end_pc, InstructionHandle handler_pc, String catch_type)
public LocalVariableGen addLocalVariable(String name, ClassGenType type, InstructionHandle start, InstructionHandle end)
public int getAccessFlags()
public ClassGenType[] getArgTypes()
public final Attribute[] getAttributes()
public String getClassName()
public final InstructionList getInstructionList()
public final LocalVariableGen[] getLocalVariables()
public Method getMethod(int max_stack)
public String getMethodName()
public ClassGenType getReturnType()
public LocalVariableGen lookupLocal(String name)
public final void removeNOPs()
public void setAccessFlags(short access_flags)
public void setArgTypes(ClassGenType[] arg_types)
public void setMethodName(String method_name)
public void setReturnType(ClassGenType return_type)
Association Links |
to Class java.lang.String
to Class jellyj.classfile.classgen.ClassGenType
to Class jellyj.classfile.classgen.ClassGenType
to Class java.lang.String
to Class jellyj.classfile.classgen.InstructionList
to Class jellyj.classfile.classgen.ConstantPoolGen
to Class java.util.Vector
to Class java.util.Vector
to Class java.util.Vector
to Class java.util.Vector
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |