InstructionList
, Method
Modifier and Type | Class and Description |
---|---|
pack-priv static class | |
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private String[] | |
private Type[] | |
private static BCELComparator | |
private String | |
private final List | |
private final List | |
private boolean | |
private boolean | |
private InstructionList | |
private final List | |
private LocalVariableTypeTable | |
private int | |
private int | |
private List | |
private List | |
private boolean | |
private final List | |
private final List |
Access | Constructor and Description |
---|---|
public | MethodGen(final int
access qualifiers accessFlags, final Type method type returnType, final Type[] argument types argTypes, String[] argument names (if this is null, default names will be provided for them) argNames, final String name of method methodName, final String class name containing this method (may be null, if you don't care) className, final InstructionList instruction list associated with this method, may be null only for abstract or native methods il, final ConstantPoolGen constant pool cp)Declare method. |
public | MethodGen(final Method
method method, final String class name containing this method className, final ConstantPoolGen constant pool cp)Instantiate from existing method. |
Modifier and Type | Method and Description |
---|---|
public void | |
public void | |
public void | addException(final String
(fully qualified) name of exception className)Add an exception possibly thrown by this method. |
public CodeExceptionGen | Returns: new exception handler objectStart of region (inclusive) startPc, final InstructionHandle End of region (inclusive) endPc, final InstructionHandle Where handling is done handlerPc, final ObjectType class type of handled exception or null if any exception is handled catchType)Add an exception handler, i.e., specify region where a handler is active and an instruction where the actual handling is done. |
public LineNumberGen | Returns: new line number objectinstruction to tag ih, final int srcLine)Give an instruction a line number corresponding to the source code line. |
public LocalVariableGen | Returns: new local variable objectvariable name name, final Type variable type type, final InstructionHandle from where the variable is valid, if this is null, it is valid from the start start, final InstructionHandle until where the variable is valid, if this is null, it is valid to the end end)Adds a local variable to this method and assigns an index automatically. |
public LocalVariableGen | Returns: new local variable objectvariable name name, final Type variable type type, final int the index of the local variable, if type is long or double, the next available index is slot+2 slot, final InstructionHandle from where the variable is valid start, final InstructionHandle until where the variable is valid end)Adds a local variable to this method. |
public LocalVariableGen | Returns: new local variable objectvariable name name, final Type variable type type, final int the index of the local variable, if type is long or double, the next available index is slot+2 slot, final InstructionHandle from where the variable is valid start, final InstructionHandle until where the variable is valid end, final int the index of the local variable prior to any modifications origIndex)Adds a local variable to this method. |
public void | |
public void | |
public void | |
private Attribute[] | |
private Attribute[] | |
private void | |
public MethodGen | |
private void | ensureExistingParameterAnnotationsUnpacked()
Goes through the attributes on the method and identifies any that are RuntimeParameterAnnotations, extracting their contents and storing them as parameter annotations. |
public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
public List | getAnnotationsOnParameter(final int i)
Return a list of AnnotationGen objects representing parameter annotations |
public String | |
public String[] | |
public Type | |
public Type[] | |
private static byte[] | |
public String | |
public Attribute[] | |
private CodeException[] | |
public static BCELComparator | |
public CodeExceptionGen[] | |
public String[] | |
private ExceptionTable | Returns: 'Exceptions' attribute of all the exceptions thrown by this method.
|
public InstructionList | |
public LineNumberGen[] | |
public LineNumberTable | Returns: 'LineNumberTable' attribute of all the local variables of this method.
|
public LocalVariableGen[] | |
public LocalVariableTable | Returns: 'LocalVariableTable' attribute of all the local variables of this method.
|
public LocalVariableTypeTable | |
public int | |
public static int | Returns: maximum stack depth used by methodComputes stack usage of an instruction list by performing control flow analysis. |
public int | |
public Method | |
public Type | |
public String | getSignature()
Implements abstract com. |
public int | hashCode()
Overrides java. |
private List | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | removeLocalVariable(final LocalVariableGen l)
Remove a local variable, its slot will not be reused, if you do not use addLocalVariable with an explicit index argument. |
public void | |
public void | |
public void | removeNOPs()
Remove all NOPs from the instruction list (if possible) and update every object referring to them, i.e., branch instructions, local variables and exception handlers. |
public void | |
public void | removeRuntimeAttributes(final Attribute[] attrs)
Would prefer to make this private, but need a way to test if client is using BCEL version 6.5.0 or later that contains fix for BCEL-329. |
public void | |
public void | |
public void | |
public void | |
public void | |
public static void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | stripAttributes(final boolean flag)
Do not/Do produce attributes code attributesLineNumberTable and LocalVariableTable, like javac -O |
public final String | Returns: String representation of the method.Overrides java. |
public void | |
private void |