Constructor and Description |
---|
Utility() |
Modifier and Type | Method and Description |
---|---|
static String |
accessToString(int access_flags)
Convert bit field of flags into string such as `static final'.
|
static String |
accessToString(int access_flags,
boolean for_class)
Convert bit field of flags into string such as `static final'.
|
static String |
classOrInterface(int access_flags) |
static String |
codeToString(byte[] code,
ConstantPool constant_pool,
int index,
int length,
boolean verbose)
Disassemble a byte array of JVM byte codes starting from code line
`index' and return the disassembled string representation.
|
static String |
codeToString(ByteSequence bytes,
ConstantPool constant_pool,
boolean verbose)
Disassemble a stream of byte codes and return the
string representation.
|
static String |
compactClassName(String str)
Shorten long class names, java/lang/String becomes
String.
|
static String |
compactClassName(String str,
boolean chopit)
Shorten long class names, java/lang/String becomes
java.lang.String,
e.g..
|
static String |
compactClassName(String str,
String prefix,
boolean chopit)
Shorten long class name str, i.e., chop off the prefix,
if the
class name starts with this string and the flag chopit is true.
|
static String |
convertString(String label)
Escape all occurences of newline chars '\n', quotes \", etc.
|
static String |
fillup(String str,
int length,
boolean left_justify,
char fill)
Fillup char with up to length characters with char `fill' and justify it left or right.
|
static String |
methodSignatureToString(String signature,
String name,
String access,
boolean chopit,
LocalVariableTable vars)
A returntype signature represents the return value from a method.
|
static String |
replace(String str,
String old,
String new_)
Replace all occurrences of old in str with new.
|
static String |
signatureToString(String signature)
Converts signature to string with all class names compacted.
|
static String |
signatureToString(String signature,
boolean chopit)
The field signature represents the value of an argument to a function or
the value of a variable.
|
static String |
toHexString(byte[] bytes)
Convert bytes into hexadecimal string
|
public static final String accessToString(int access_flags)
access_flags
- Access flagspublic static final String accessToString(int access_flags, boolean for_class)
access_flags
- Access flagsfor_class
- access flags are for class qualifiers ?public static final String classOrInterface(int access_flags)
access_flags
- the class flagspublic static final String codeToString(byte[] code, ConstantPool constant_pool, int index, int length, boolean verbose)
code
- byte code arrayconstant_pool
- Array of constantsindex
- offset in `code' array
(number of opcodes, not bytes!)length
- number of opcodes to decompile, -1 for allverbose
- be verbose, e.g. print constant pool indexpublic static final String codeToString(ByteSequence bytes, ConstantPool constant_pool, boolean verbose) throws IOException
bytes
- stream of bytesconstant_pool
- Array of constantsverbose
- be verbose, e.g. print constant pool indexIOException
- if a failure from reading from the bytes argument occurspublic static final String compactClassName(String str)
str
- The long class namepublic static final String compactClassName(String str, String prefix, boolean chopit)
str
- The long class nameprefix
- The prefix the get rid offchopit
- Flag that determines whether chopping is executed or notpublic static final String compactClassName(String str, boolean chopit)
str
- The long class namechopit
- Flag that determines whether chopping is executed or notpublic static final String methodSignatureToString(String signature, String name, String access, boolean chopit, LocalVariableTable vars) throws ClassFormatException
signature
- Method signaturename
- Method nameaccess
- Method access rightschopit
- vars
- ClassFormatException
public static final String replace(String str, String old, String new_)
str
- String to permuteold
- String to be replacednew_
- Replacement stringpublic static final String signatureToString(String signature)
signature
- to convertpublic static final String signatureToString(String signature, boolean chopit)
This method converts this string into a Java type declaration such as `String[]' and throws a `ClassFormatException' when the parsed type is invalid.::= ::= | | ::= B|C|D|F|I|J|S|Z ::= L ; ::= [ The meaning of the base types is as follows: B byte signed byte C char character D double double precision IEEE float F float single precision IEEE float I int integer J long long integer L ; ... an object of the given class S short signed short Z boolean true or false [ ... array
signature
- Class signaturechopit
- Flag that determines whether chopping is executed or notClassFormatException
public static final String toHexString(byte[] bytes)
bytes
- an array of bytes to convert to hexadecimalpublic static final String fillup(String str, int length, boolean left_justify, char fill)
str
- string to formatlength
- length of desired stringleft_justify
- format left or rightfill
- fill characterCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.