Interface MethodInfo
- All Known Implementing Classes:
Method
public interface MethodInfo
MethodInfo provides methods for accessing and modifying a method. It is
implemented by file.Method.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a clone of this MethodInfo except that its declaring class does not know about it.byte[]code()Get the byte code array of the method.Returns the class which declared the method.Catch[]Get the exception handlers in the method.int[]Get the indices into the constant pool of the types of the exceptions thrown by the method.Get the line number debug info of the instructions in the method.locals()Get the local variable debug information for the method.intGet the maximum number of locals used in the method.intmaxStack()Get the maximum height of the operand stack.intGet the modifiers of the method.intReturns the index into the constant pool of the name of the method.voidsetCode(byte[] code) Set the byte code array of the method.voidsetExceptionHandlers(Catch[] exceptions) Set the exception handlers in the method.voidsetLineNumbers(LineNumberDebugInfo[] lineNumbers) Set the line number debug info of the instructions in the method.voidsetLocals(LocalDebugInfo[] locals) Set the local variables in the method.voidsetMaxLocals(int maxLocals) Set the maximum number of locals used in the method.voidsetMaxStack(int maxStack) Set the maximum height of the operand stack.voidsetModifiers(int modifiers) Set the modifiers of the method.voidsetNameIndex(int index) Sets the index into the constant pool of the name of the method.voidsetTypeIndex(int index) Set the index into the constant pool of the type of the method.intReturns the index into the constant pool of the type of the method.
-
Method Details
-
declaringClass
ClassInfo declaringClass()Returns the class which declared the method. -
nameIndex
int nameIndex()Returns the index into the constant pool of the name of the method. -
typeIndex
int typeIndex()Returns the index into the constant pool of the type of the method. -
setNameIndex
void setNameIndex(int index) Sets the index into the constant pool of the name of the method. -
setTypeIndex
void setTypeIndex(int index) Set the index into the constant pool of the type of the method.- Parameters:
index- The index into the constant pool of the type of the method.
-
setModifiers
void setModifiers(int modifiers) Set the modifiers of the method. The values correspond to the constants in the Modifiers class.- Parameters:
modifiers- A bit vector of modifier flags for the method.- See Also:
-
modifiers
int modifiers()Get the modifiers of the method. The values correspond to the constants in the Modifiers class.- Returns:
- A bit vector of modifier flags for the method.
- See Also:
-
exceptionTypes
int[] exceptionTypes()Get the indices into the constant pool of the types of the exceptions thrown by the method.- Returns:
- The indices into the constant pool of the types of the exceptions thrown by the method.
-
maxStack
int maxStack()Get the maximum height of the operand stack.- Returns:
- The maximum height of the operand stack.
-
setMaxStack
void setMaxStack(int maxStack) Set the maximum height of the operand stack.- Parameters:
maxStack- The maximum height of the operand stack.
-
maxLocals
int maxLocals()Get the maximum number of locals used in the method.- Returns:
- The maximum number of locals used in the method.
-
setMaxLocals
void setMaxLocals(int maxLocals) Set the maximum number of locals used in the method.- Parameters:
maxLocals- The maximum number of locals used in the method.
-
code
byte[] code()Get the byte code array of the method.- Returns:
- The byte code array of the method.
-
setCode
void setCode(byte[] code) Set the byte code array of the method.- Parameters:
code- The byte code array of the method.
-
lineNumbers
LineNumberDebugInfo[] lineNumbers()Get the line number debug info of the instructions in the method.- Returns:
- The line numbers of the instructions in the method. The array will be of size 0 if the method has no line number debug info.
-
setLineNumbers
Set the line number debug info of the instructions in the method.- Parameters:
lineNumbers- The line numbers of the instructions in the method. The array will be of size 0 if the method has no line number debug info.
-
locals
LocalDebugInfo[] locals()Get the local variable debug information for the method.- Returns:
- The local variables in the method. The array will be of size 0 if the method has no local variable debug info.
-
setLocals
Set the local variables in the method.- Parameters:
locals- The local variables in the method.
-
exceptionHandlers
Catch[] exceptionHandlers()Get the exception handlers in the method.- Returns:
- The exception handlers in the method.
-
setExceptionHandlers
Set the exception handlers in the method.- Parameters:
exceptions- The exception handlers in the method.
-
clone
Object clone()Creates a clone of this MethodInfo except that its declaring class does not know about it.
-