@Deprecated
public final class BCELUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
skip_checks
Deprecated.
Controls whether the checks in checkMgen are actually performed.
|
Modifier and Type | Method and Description |
---|---|
static void |
add_line_numbers(org.apache.bcel.generic.MethodGen mg,
org.apache.bcel.generic.InstructionList il)
Deprecated.
Builds an array of line numbers for the specified instruction list.
|
static void |
add_to_start(org.apache.bcel.generic.MethodGen mg,
org.apache.bcel.generic.InstructionList nl)
Deprecated.
Adds code in nl to start of method mg.
|
static org.apache.bcel.generic.Type[] |
add_type(org.apache.bcel.generic.Type[] types,
org.apache.bcel.generic.Type new_type)
|
static void |
checkMgen(org.apache.bcel.generic.MethodGen mgen)
Deprecated.
Checks the specific method for consistency.
|
static void |
checkMgens(org.apache.bcel.generic.ClassGen gen)
Deprecated.
Checks all of the methods in gen for consistency.
|
static org.apache.bcel.generic.Type |
classname_to_type(java.lang.String classname)
Deprecated.
Return the type corresponding to a given fully-qualified class name.
|
static void |
dump(org.apache.bcel.classfile.JavaClass jc,
java.io.File dump_dir)
Deprecated.
Dumps the contents of the specified class to the specified directory.
|
static void |
dump(org.apache.bcel.classfile.JavaClass jc,
java.lang.String dump_dir)
Deprecated.
Dumps the contents of the specified class to the specified directory.
|
static void |
empty_method(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Empties the method of all code (except for a return).
|
static java.lang.String |
get_attribute_name(org.apache.bcel.classfile.Attribute a)
Deprecated.
Return the attribute name for the specified attribute.
|
static java.lang.String |
get_attribute_name(org.apache.bcel.classfile.Attribute a,
org.apache.bcel.generic.ConstantPoolGen pool)
Deprecated.
Return the attribute name for the specified attribute.
|
static java.lang.String |
get_constant_str(org.apache.bcel.classfile.ConstantPool pool,
int index)
Deprecated.
Returns the constant string at the specified offset.
|
static java.lang.String |
get_method_declaration(org.apache.bcel.classfile.Method m)
Deprecated.
Returns a string describing a method declaration.
|
static boolean |
in_jdk_internalform(java.lang.String classname)
Deprecated.
Returns whether or not the class is part of the JDK (rt.jar).
|
static boolean |
in_jdk(org.apache.bcel.generic.ClassGen gen)
Deprecated.
Returns whether or not the class is part of the JDK (rt.jar).
|
static boolean |
in_jdk(java.lang.String classname)
Deprecated.
Returns whether or not the class is part of the JDK (rt.jar).
|
static org.apache.bcel.generic.Type[] |
insert_type(org.apache.bcel.generic.Type new_type,
org.apache.bcel.generic.Type[] types)
|
static java.lang.String |
instruction_descr(org.apache.bcel.generic.InstructionList il,
org.apache.bcel.generic.ConstantPoolGen pool)
Deprecated.
|
static boolean |
is_clinit(org.apache.bcel.classfile.Method m)
Deprecated.
Returns whether or not the method is a class initializer.
|
static boolean |
is_clinit(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Returns whether or not the method is a class initializer.
|
static boolean |
is_constructor(org.apache.bcel.classfile.Method m)
Deprecated.
Returns whether or not the method is a constructor.
|
static boolean |
is_constructor(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Returns whether or not the method is a constructor.
|
static boolean |
is_local_variable_type_table(org.apache.bcel.classfile.Attribute a,
org.apache.bcel.generic.ConstantPoolGen pool)
Deprecated.
Returns whether or not the specified attribute is a local variable type table.
|
static boolean |
is_main(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Returns whether or not this is a standard main method (static, name is 'main', and one argument
of string array).
|
static java.lang.String |
local_var_descr(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Return a description of the local variables (one per line).
|
static org.apache.bcel.generic.Type[] |
postpendToArray(org.apache.bcel.generic.Type[] types,
org.apache.bcel.generic.Type new_type)
Deprecated.
Returns a copy of the given type array, with new_type added to the end.
|
static org.apache.bcel.generic.Type[] |
prependToArray(org.apache.bcel.generic.Type new_type,
org.apache.bcel.generic.Type[] types)
Deprecated.
Returns a copy of the given type array, with new_type inserted at the beginning.
|
static void |
remove_local_variable_type_tables(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Remove the local variable type table attribute (LVTT) from mg.
|
static void |
setup_init_locals(org.apache.bcel.generic.MethodGen mg)
Deprecated.
Sets the locals to 'this' and each of the arguments.
|
static java.lang.Class<?> |
type_to_class(org.apache.bcel.generic.Type type)
Deprecated.
Returns the class that corresponds to type.
|
static java.lang.String |
type_to_classgetname(org.apache.bcel.generic.Type type)
Deprecated.
Returns the Java class name, in the format of
Class.getName() , that corresponds to
type. |
public static boolean skip_checks
public static java.lang.String get_method_declaration(org.apache.bcel.classfile.Method m)
m
- the methodpublic static java.lang.String get_attribute_name(org.apache.bcel.classfile.Attribute a)
a
- the attributepublic static java.lang.String get_constant_str(org.apache.bcel.classfile.ConstantPool pool, int index)
pool
- the constant poolindex
- the index in the constant poolpublic static boolean is_constructor(org.apache.bcel.generic.MethodGen mg)
mg
- the method to testpublic static boolean is_constructor(org.apache.bcel.classfile.Method m)
m
- the method to testpublic static boolean is_clinit(org.apache.bcel.generic.MethodGen mg)
mg
- the method to testpublic static boolean is_clinit(org.apache.bcel.classfile.Method m)
m
- the method to testpublic static boolean in_jdk(org.apache.bcel.generic.ClassGen gen)
gen
- the class to testpublic static boolean in_jdk(java.lang.String classname)
classname
- the class to test, in the format of Class.getName(); the class should not be
an arraypublic static boolean in_jdk_internalform(java.lang.String classname)
classname
- the class to test, in internal formpublic static void checkMgen(org.apache.bcel.generic.MethodGen mgen)
mgen
- the class to checkpublic static void checkMgens(org.apache.bcel.generic.ClassGen gen)
gen
- the class to checkpublic static void add_to_start(org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.InstructionList nl)
mg
- method to be augmentednl
- instructions to prepend to the methodpublic static void dump(org.apache.bcel.classfile.JavaClass jc, java.lang.String dump_dir)
jc
- javaclass to dumpdump_dir
- directory in which to write the filedump(JavaClass, File)
public static void dump(org.apache.bcel.classfile.JavaClass jc, java.io.File dump_dir)
jc
- javaclass to dumpdump_dir
- directory in which to write the filepublic static java.lang.String instruction_descr(org.apache.bcel.generic.InstructionList il, org.apache.bcel.generic.ConstantPoolGen pool)
public static java.lang.String local_var_descr(org.apache.bcel.generic.MethodGen mg)
mg
- the method whose local variables to describepublic static void add_line_numbers(org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.InstructionList il)
mg
- the method whose line numbers to extractil
- the instruction list to augment with line numberspublic static void setup_init_locals(org.apache.bcel.generic.MethodGen mg)
mg
- the method whose locals to setpublic static void empty_method(org.apache.bcel.generic.MethodGen mg)
mg
- the method to clear outpublic static void remove_local_variable_type_tables(org.apache.bcel.generic.MethodGen mg)
mg
- the method to clear outpublic static boolean is_local_variable_type_table(org.apache.bcel.classfile.Attribute a, org.apache.bcel.generic.ConstantPoolGen pool)
a
- the attributepool
- the constant poolpublic static java.lang.String get_attribute_name(org.apache.bcel.classfile.Attribute a, org.apache.bcel.generic.ConstantPoolGen pool)
a
- the attributepool
- the constant poolpublic static boolean is_main(org.apache.bcel.generic.MethodGen mg)
mg
- the method to checkpublic static java.lang.String type_to_classgetname(org.apache.bcel.generic.Type type)
Class.getName()
, that corresponds to
type.type
- the typepublic static java.lang.Class<?> type_to_class(org.apache.bcel.generic.Type type)
type
- the typepublic static org.apache.bcel.generic.Type[] postpendToArray(org.apache.bcel.generic.Type[] types, org.apache.bcel.generic.Type new_type)
types
- the array to extendnew_type
- the element to add to the end of the array@Deprecated public static org.apache.bcel.generic.Type[] add_type(org.apache.bcel.generic.Type[] types, org.apache.bcel.generic.Type new_type)
types
- the array to extendnew_type
- the element to add to the end of the arraypublic static org.apache.bcel.generic.Type[] prependToArray(org.apache.bcel.generic.Type new_type, org.apache.bcel.generic.Type[] types)
types
- the array to extendnew_type
- the element to add to the beginning of the array@Deprecated public static org.apache.bcel.generic.Type[] insert_type(org.apache.bcel.generic.Type new_type, org.apache.bcel.generic.Type[] types)
types
- the array to extendnew_type
- the element to add to the beginning of the arraypublic static org.apache.bcel.generic.Type classname_to_type(java.lang.String classname)
classname
- the fully-qualified name of a class