|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectBCELUtil
public class BCELUtil
Static utility methods for working with BCEL.
| Field Summary | |
|---|---|
static boolean |
skip_checks
Controls whether the checks in checkMgen are actually performed * |
| Constructor Summary | |
|---|---|
BCELUtil()
|
|
| Method Summary | |
|---|---|
static void |
add_line_numbers(MethodGen mg,
InstructionList il)
Builds an array of line numbers for the specified instruction list. |
static void |
add_to_start(MethodGen mg,
InstructionList nl)
Adds code in nl to start of method mg * |
static Type[] |
add_type(Type[] types,
Type new_type)
Returns a type array with new_type added to the end of types |
static void |
checkMgen(MethodGen mgen)
Checks the specific method for consistency. |
static void |
checkMgens(ClassGen gen)
Checks all of the methods in gen for consistency. |
static Type |
classname_to_type(String classname)
|
static void |
dump(JavaClass jc,
File dump_dir)
Dumps the contents of the specified class to the specified directory. |
static void |
dump(JavaClass jc,
String dump_dir)
|
static void |
empty_method(MethodGen mg)
Empties the method of all code (except for a return). |
static String |
get_attribute_name(Attribute a)
Returns the attribute name for the specified attribute. |
static String |
get_attribute_name(Attribute a,
ConstantPoolGen pool)
Returns the attribute name for the specified attribute. |
static String |
get_constant_str(ConstantPool pool,
int index)
Returns the constant string at the specified offset |
static String |
get_method_declaration(Method m)
Returns a string describing a method declaration. |
static boolean |
in_jdk(ClassGen gen)
returns whether or not the class is part of the JDK (rt.jar) * |
static boolean |
in_jdk(String classname)
returns whether or not the classname is part of the JDK (rt.jar) * |
static Type[] |
insert_type(Type new_type,
Type[] types)
Returns a type array with new_type inserted at the beginning |
static String |
instruction_descr(InstructionList il,
ConstantPoolGen pool)
|
static boolean |
is_clinit(Method m)
returns whether or not the specified method is a class initializer |
static boolean |
is_clinit(MethodGen mg)
returns whether or not the specified method is a class initializer |
static boolean |
is_constructor(Method m)
returns whether or not the specified method is a constructor * |
static boolean |
is_constructor(MethodGen mg)
returns whether or not the specified method is a constructor * |
static boolean |
is_local_variable_type_table(Attribute a,
ConstantPoolGen pool)
Returns whether or not the specified attribute is a local variable type table. |
static boolean |
is_main(MethodGen mg)
Returns whether or not this is a standard main method (static, name is 'main', and one argument of string array. |
static String |
local_var_descr(MethodGen mg)
Return a description of the local variables (one per line). |
static void |
remove_local_variable_type_tables(MethodGen mg)
Remove the local variable type table attribute (LVTT) from mg. |
static void |
setup_init_locals(MethodGen mg)
Sets the locals to 'this' and each of the arguments. |
static Class |
type_to_class(Type type)
Returns the class that corresponds to type |
static String |
type_to_classname(Type type)
Returns the java classname that corresponds to type |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean skip_checks
| Constructor Detail |
|---|
public BCELUtil()
| Method Detail |
|---|
public static String get_method_declaration(Method m)
public static String get_attribute_name(Attribute a)
public static String get_constant_str(ConstantPool pool,
int index)
public static boolean is_constructor(MethodGen mg)
public static boolean is_constructor(Method m)
public static boolean is_clinit(MethodGen mg)
public static boolean is_clinit(Method m)
public static boolean in_jdk(ClassGen gen)
public static boolean in_jdk(String classname)
public static void checkMgen(MethodGen mgen)
public static void checkMgens(ClassGen gen)
public static void add_to_start(MethodGen mg,
InstructionList nl)
public static void dump(JavaClass jc,
String dump_dir)
dump(JavaClass, File)
public static void dump(JavaClass jc,
File dump_dir)
jc - javaclass to dumpdump_dir - directory in which to write the file
public static String instruction_descr(InstructionList il,
ConstantPoolGen pool)
public static String local_var_descr(MethodGen mg)
public static void add_line_numbers(MethodGen mg,
InstructionList il)
public static void setup_init_locals(MethodGen mg)
public static void empty_method(MethodGen mg)
public static void remove_local_variable_type_tables(MethodGen mg)
public static boolean is_local_variable_type_table(Attribute a,
ConstantPoolGen pool)
public static String get_attribute_name(Attribute a,
ConstantPoolGen pool)
public static boolean is_main(MethodGen mg)
public static String type_to_classname(Type type)
public static Class type_to_class(Type type)
public static Type[] add_type(Type[] types,
Type new_type)
public static Type[] insert_type(Type new_type,
Type[] types)
public static Type classname_to_type(String classname)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||