Modifier and Type | Class and Description |
---|---|
private static class | Utility.
Decode characters into bytes. |
private static class | Utility.
Encode bytes into valid java identifier characters. |
Modifier and Type | Field and Description |
---|---|
private static final int[] | |
private static final ThreadLocal | |
private static final char | |
private static final int | |
private static final int[] | |
private static boolean |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public static String | Returns: String representation of flagsAccess flags accessFlags)Convert bit field of flags into string such as 'static final'. |
public static String | Returns: String representation of flagsAccess flags accessFlags, final boolean access flags are for class qualifiers ? forClass)Convert bit field of flags into string such as 'static final'. |
private static short | byteToShort(final byte b)
Convert (signed) byte to (unsigned) short value, i.e., all negative values become positive. |
public static String | Returns: "class" or "interface", depending on the ACC_INTERFACE flagthe class flags accessFlags)
|
public static int | |
public static String | |
public static String | Returns: String representation of byte codesbyte code array code, final ConstantPool Array of constants constantPool, final int offset in 'code' array (number of opcodes, not bytes!) index, final int number of opcodes to decompile, -1 for all length, final boolean be verbose, e.g. print constant pool index verbose)Disassemble a byte array of JVM byte codes starting from code line 'index' and return the disassembled string representation. |
public static String | |
public static String | Returns: String representation of byte codestream of bytes bytes, final ConstantPool Array of constants constantPool, final boolean be verbose, e.g. print constant pool index verbose)Disassemble a stream of byte codes and return the string representation. |
public static String | Returns: Compacted class nameThe long class name str)Shorten long class names, java/lang/String becomes String. |
public static String | Returns: Compacted class nameThe long class name str, final boolean flag that determines whether chopping is executed or not chopit)Shorten long class names, java/lang/String becomes java.lang.String, e.g.. |
public static String | Returns: Compacted class nameThe long class name str, final String The prefix the get rid off prefix, final boolean flag that determines whether chopping is executed or not 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. |
public static String | |
private static int | |
public static byte[] | |
public static String | encode(byte[]
the byte array to convert bytes, final boolean use gzip to minimize string compress)Encode byte array it into Java identifier string, i.e., a string that only contains the following characters: (a, ... |
public static String | |
public static String | Returns: formatted intinteger to format i, final int length of desired string length, final boolean format left or right leftJustify, final char fill character fill)Return a string for an integer justified left or right and filled up with 'fill' characters if necessary. |
public static String | Returns: byte code signatureJava type type)Parse Java type such as "char", or "java.lang.String[]" and return the signature in byte code format, e.g. "C" or "[Ljava/lang/String;" respectively. |
public static boolean | Returns: true, if character is one of (a, ... z, A, ... Z, 0, ... 9, _)the character to test if it's part of an identifier ch)
|
public static boolean | |
public static String[] | Returns: String Array of argument typesMethod signature signature)Converts argument list portion of method signature to string with all class names compacted. |
public static String[] | Returns: String Array of argument typesMethod signature signature, final boolean flag that determines whether chopping is executed or not chopit)Converts argument list portion of method signature to string. |
public static String | Returns: String representation of method return typeMethod signature signature)Converts return type portion of method signature to string with all class names compacted. |
public static String | Returns: String representation of method return typeMethod signature signature, final boolean flag that determines whether chopping is executed or not chopit)Converts return type portion of method signature to string. |
public static String | Returns: Human readable signatureto convert signature, final String of method name, final String flags of method access)Converts method signature to string with all class names compacted. |
public static String | Returns: Human readable signatureto convert signature, final String of method name, final String flags of method access, final boolean flag that determines whether chopping is executed or not chopit)Converts method signature to string. |
public static String | Returns: Java type declarationMethod signature signature, final String Method name name, final String Method access rights access, final boolean flag that determines whether chopping is executed or not chopit, final LocalVariableTable the LocalVariableTable for the method vars)This method converts a method signature string into a Java type declaration like 'void main(String[])' and throws a 'ClassFormatException' when the parsed type is invalid. |
public static String | Returns: Byte code representation of method signatureReturn type of method ret, final String[] Types of method arguments argv)Converts string containing the method return and argument types to a byte code method signature. |
public static String | |
public static String | Returns: a package name.the source path. str)Converts a path to a package name. |
private static int | |
public static String | |
public static String | |
public static String | |
public static void | |
public static void | |
public static String | |
public static short | |
public static int | |
public static String | Returns: String containg human readable signaturesignature to convert signature)Converts a signature to a string with all class names compacted. |
public static String | Returns: String containg human readable signaturesignature to convert signature, final boolean flag that determines whether chopping is executed or not chopit)Converts a signature to a string. |
public static String | Returns: bytes as hexadecimal string, e.g. 00 fa 12 ...an array of bytes to convert to hexadecimal bytes)Convert bytes into hexadecimal string |
public static byte | Returns: type of method signaturein format described above signature)Return type of method signature as a byte value as defined in Constants |
public static byte | Returns: type of signaturein format described above signature)Return type of signature as a byte value as defined in Constants |
private static String | Returns: String containg human readable signaturesignature to convert signature, final boolean flag that determines whether chopping is executed or not chopit)Converts a type parameter list signature to a string. |
private static String | Returns: String containg human readable signaturesignature to convert signature, final boolean flag that determines whether chopping is executed or not chopit)Converts a type parameter signature to a string. |
private static String | Returns: String containg human readable signaturesignature to convert signature, final boolean flag that determines whether chopping is executed or not chopit, final char character indicating the end of the list term)Converts a list of type signatures to a string. |
public static String | Returns: string containing human readable type signaturetype signature signature, final boolean flag that determines whether chopping is executed or not chopit)This method converts a type signature string into a Java type declaration such as 'String[]' and throws a 'ClassFormatException' when the parsed type is invalid. |
private static int | |
private static void |
CHAR_MAP | back to summary |
---|---|
private static final int[] CHAR_MAP |
CONSUMER_CHARS | back to summary |
---|---|
private static final ThreadLocal<Integer> CONSUMER_CHARS |
ESCAPE_CHAR | back to summary |
---|---|
private static final char ESCAPE_CHAR |
FREE_CHARS | back to summary |
---|---|
private static final int FREE_CHARS |
MAP_CHAR | back to summary |
---|---|
private static final int[] MAP_CHAR |
wide | back to summary |
---|---|
private static boolean wide |
Utility | back to summary |
---|---|
public Utility() |
accessToString | back to summary |
---|---|
public static String accessToString(final int accessFlags) Convert bit field of flags into string such as 'static final'.
|
accessToString | back to summary |
---|---|
public static String accessToString(final int accessFlags, final boolean forClass) Convert bit field of flags into string such as 'static final'. Special case: Classes compiled with new compilers and with the 'ACC_SUPER' flag would be said to be "synchronized". This is because SUN used the same value for the flags 'ACC_SUPER' and 'ACC_SYNCHRONIZED'.
|
byteToShort | back to summary |
---|---|
private static short byteToShort(final byte b) Convert (signed) byte to (unsigned) short value, i.e., all negative values become positive. |
classOrInterface | back to summary |
---|---|
public static String classOrInterface(final int accessFlags)
|
clearBit | back to summary |
---|---|
public static int clearBit(final int flag, final int i)
|
codeToString | back to summary |
---|---|
public static String codeToString(final byte[] code, final ConstantPool constantPool, final int index, final int length) |
codeToString | back to summary |
---|---|
public static String codeToString(final byte[] code, final ConstantPool constantPool, final int index, final int length, final boolean verbose) Disassemble a byte array of JVM byte codes starting from code line 'index' and return the disassembled string representation. Decode only 'num' opcodes (including their operands), use -1 if you want to decompile everything.
|
codeToString | back to summary |
---|---|
public static String codeToString(final ByteSequence bytes, final ConstantPool constantPool) throws IOException |
codeToString | back to summary |
---|---|
public static String codeToString(final ByteSequence bytes, final ConstantPool constantPool, final boolean verbose) throws IOException Disassemble a stream of byte codes and return the string representation.
|
compactClassName | back to summary |
---|---|
public static String compactClassName(final String str) Shorten long class names, java/lang/String becomes String. |
compactClassName | back to summary |
---|---|
public static String compactClassName(final String str, final boolean chopit) Shorten long class names, java/lang/String becomes java.lang.String, e.g.. If chopit is true the prefix java.lang is also removed. |
compactClassName | back to summary |
---|---|
public static String compactClassName(String str, final String prefix, final 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. Slashes / are converted to dots .. |
convertString | back to summary |
---|---|
public static String convertString(final String label) Escape all occurrences of newline chars '\n', quotes \", etc. |
countBrackets | back to summary |
---|---|
private static int countBrackets(final String brackets) |
decode | back to summary |
---|---|
public static byte[] decode(final String s, final boolean uncompress) throws IOException Decode a string back to a byte array.
|
encode | back to summary |
---|---|
public static String encode(byte[] bytes, final boolean compress) throws IOException Encode byte array it into Java identifier string, i.e., a string that only contains the following characters: (a, ... z, A, ... Z, 0, ... 9, _, $). The encoding algorithm itself is not too clever: if the current byte's ASCII value already is a valid Java identifier part, leave it as it is. Otherwise it writes the escape character($) followed by:
This operation inflates the original byte array by roughly 40-50%
|
fillup | back to summary |
---|---|
public static String fillup(final String str, final int length, final boolean leftJustify, final char fill) Fillup char with up to length characters with char 'fill' and justify it left or right. |
format | back to summary |
---|---|
public static String format(final int i, final int length, final boolean leftJustify, final char fill) Return a string for an integer justified left or right and filled up with 'fill' characters if necessary.
|
getSignature | back to summary |
---|---|
public static String getSignature(String type) Parse Java type such as "char", or "java.lang.String[]" and return the signature in byte code format, e.g. "C" or "[Ljava/lang/String;" respectively. |
isJavaIdentifierPart | back to summary |
---|---|
public static boolean isJavaIdentifierPart(final char ch)
|
isSet | back to summary |
---|---|
public static boolean isSet(final int flag, final int i)
|
methodSignatureArgumentTypes | back to summary |
---|---|
public static String[] methodSignatureArgumentTypes(final String signature) throws ClassFormatException Converts argument list portion of method signature to string with all class names compacted.
|
methodSignatureArgumentTypes | back to summary |
---|---|
public static String[] methodSignatureArgumentTypes(final String signature, final boolean chopit) throws ClassFormatException Converts argument list portion of method signature to string.
|
methodSignatureReturnType | back to summary |
---|---|
public static String methodSignatureReturnType(final String signature) throws ClassFormatException Converts return type portion of method signature to string with all class names compacted.
|
methodSignatureReturnType | back to summary |
---|---|
public static String methodSignatureReturnType(final String signature, final boolean chopit) throws ClassFormatException Converts return type portion of method signature to string.
|
methodSignatureToString | back to summary |
---|---|
public static String methodSignatureToString(final String signature, final String name, final String access) Converts method signature to string with all class names compacted. |
methodSignatureToString | back to summary |
---|---|
public static String methodSignatureToString(final String signature, final String name, final String access, final boolean chopit) Converts method signature to string. |
methodSignatureToString | back to summary |
---|---|
public static String methodSignatureToString(final String signature, final String name, final String access, final boolean chopit, final LocalVariableTable vars) throws ClassFormatException This method converts a method signature string into a Java type declaration like 'void main(String[])' and throws a 'ClassFormatException' when the parsed type is invalid.
|
methodTypeToSignature | back to summary |
---|---|
public static String methodTypeToSignature(final String ret, final String[] argv) throws ClassFormatException Converts string containing the method return and argument types to a byte code method signature.
|
packageToPath | back to summary |
---|---|
public static String packageToPath(final String name) Converts '.'s to '/'s. |
pathToPackage | back to summary |
---|---|
public static String pathToPackage(final String str) Converts a path to a package name. |
pow2 | back to summary |
---|---|
private static int pow2(final int n) |
printArray | back to summary |
---|---|
public static String printArray(final Object[] obj) |
printArray | back to summary |
---|---|
public static String printArray(final Object[] obj, final boolean braces) |
printArray | back to summary |
---|---|
public static String printArray(final Object[] obj, final boolean braces, final boolean quote) |
printArray | back to summary |
---|---|
public static void printArray(final PrintStream out, final Object[] obj) |
printArray | back to summary |
---|---|
public static void printArray(final PrintWriter out, final Object[] obj) |
replace | back to summary |
---|---|
public static String replace(String str, final String old, final String new_) Replace all occurrences of old in str with new. |
searchOpcode | back to summary |
---|---|
public static short searchOpcode(String name) Map opcode names to opcode numbers. E.g., return Constants.ALOAD for "aload" |
setBit | back to summary |
---|---|
public static int setBit(final int flag, final int i)
|
signatureToString | back to summary |
---|---|
public static String signatureToString(final String signature) Converts a signature to a string with all class names compacted. Class, Method and Type signatures are supported. Enum and Interface signatures are not supported. |
signatureToString | back to summary |
---|---|
public static String signatureToString(final String signature, final boolean chopit) Converts a signature to a string. Class, Method and Type signatures are supported. Enum and Interface signatures are not supported. |
toHexString | back to summary |
---|---|
public static String toHexString(final byte[] bytes) Convert bytes into hexadecimal string
|
typeOfMethodSignature | back to summary |
---|---|
public static byte typeOfMethodSignature(final String signature) throws ClassFormatException Return type of method signature as a byte value as defined in Constants
|
typeOfSignature | back to summary |
---|---|
public static byte typeOfSignature(final String signature) throws ClassFormatException Return type of signature as a byte value as defined in Constants
|
typeParamTypesToString | back to summary |
---|---|
private static String typeParamTypesToString(final String signature, final boolean chopit) Converts a type parameter list signature to a string. |
typeParamTypeToString | back to summary |
---|---|
private static String typeParamTypeToString(final String signature, final boolean chopit) Converts a type parameter signature to a string. |
typeSignaturesToString | back to summary |
---|---|
private static String typeSignaturesToString(final String signature, final boolean chopit, final char term) Converts a list of type signatures to a string. |
typeSignatureToString | back to summary |
---|---|
public static String typeSignatureToString(final String signature, final boolean chopit) throws ClassFormatException This method converts a type signature string into a Java type declaration such as 'String[]' and throws a 'ClassFormatException' when the parsed type is invalid.
|
unwrap | back to summary |
---|---|
private static int unwrap(final ThreadLocal<Integer> tl) |
wrap | back to summary |
---|---|
private static void wrap(final ThreadLocal<Integer> tl, final int value) |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public int | |
public int | read(final char[]
Destination buffer cbuf, final int Offset at which to start storing characters off, final int Maximum number of characters to read len)Overrides java. |
JavaReader | back to summary |
---|---|
public JavaReader(final Reader in) |
read | back to summary |
---|---|
public int read() throws IOException Overrides java. Doc from java. Reads a single character.
|
read | back to summary |
---|---|
public int read(final char[] cbuf, final int off, final int len) throws IOException Overrides java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
|
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | write(final char[]
Buffer of characters to be written cbuf, final int Offset from which to start reading characters off, final int Number of characters to be written len)Overrides java. |
public void | write(final int
int specifying a character to be written b)Overrides java. |
public void | write(final String
String to be written str, final int Offset from which to start reading characters off, final int Number of characters to be written len)Overrides java. |
JavaWriter | back to summary |
---|---|
public JavaWriter(final Writer out) |
write | back to summary |
---|---|
public void write(final char[] cbuf, final int off, final int len) throws IOException Overrides java. Doc from java. Writes a portion of an array of characters.
|
write | back to summary |
---|---|
public void write(final int b) throws IOException Overrides java. Doc from java. Writes a single character.
|
write | back to summary |
---|---|
public void write(final String str, final int off, final int len) throws IOException Overrides java. Doc from java. Writes a portion of a string.
|