public class FormatToolkit
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ARRAY |
private static char |
CLASS_PREFIX |
private static char |
CLASS_SUFFIX |
private static java.lang.String |
COMMA_SEPARATOR |
private static char |
LB |
private static char |
LP |
private static char |
PACKAGE_SEPARATOR |
private static char |
RP |
Constructor and Description |
---|
FormatToolkit() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
getClass(java.lang.String clazz,
boolean qualified) |
static java.lang.String |
getHumanReadable(IMCClassLoader classLoader)
Get a human readable string representing a classloader.
|
static java.lang.String |
getHumanReadable(IMCMethod method)
Get a human readable string representing a method, displays all available information
|
static java.lang.String |
getHumanReadable(IMCMethod method,
boolean showReturnValue,
boolean showReturnValuePackage,
boolean showClassName,
boolean showClassPackageName,
boolean showArguments,
boolean showArgumentsPackage)
Get a human readable string representing a method.
|
static java.lang.String |
getHumanReadable(IMCStackTrace trace)
Get a human readable string representing a stack trace, displays all available information.
|
static java.lang.String |
getHumanReadable(IMCStackTrace trace,
boolean showReturnValue,
boolean showReturnValuePackage,
boolean showClassName,
boolean showClassPackageName,
boolean showArguments,
boolean showArgumentsPackage,
int maximumVisibleStackTraceElements,
java.lang.String indent,
java.lang.String linePrefix,
java.lang.String lineSeparator)
Get a human readable string representing a stack trace.
|
static java.lang.String |
getHumanReadable(IMCStackTrace trace,
java.lang.String indent,
java.lang.String linePrefix,
java.lang.String lineSeparator)
Get a human readable string representing a stack trace, displays all available information.
|
static java.lang.String |
getPackage(IMCPackage mcPackage)
Get the package name as a human readable string.
|
private static java.lang.String |
getParameters(java.lang.String descriptor,
boolean qualified) |
private static java.lang.String |
getPrimitiveType(char ch) |
private static java.lang.String |
getReturnType(java.lang.String descriptor,
boolean qualified) |
static java.lang.String |
getType(IMCType type,
boolean qualified)
Get the type name as a human readable string.
|
private static int |
parseToken(java.lang.StringBuffer output,
java.lang.String input,
int position,
boolean qualified) |
private static int |
readArray(java.lang.StringBuffer output,
java.lang.String input,
int position,
boolean qualified) |
private static int |
readComponentType(java.lang.StringBuffer output,
java.lang.String input,
int position,
boolean qualified) |
private static int |
readPrimitive(java.lang.StringBuffer output,
java.lang.String input,
int position,
boolean qualified) |
private static int |
write(java.lang.StringBuffer output,
java.lang.String string,
int next_position) |
private static final char LP
private static final char RP
private static final char LB
private static final char CLASS_SUFFIX
private static final char CLASS_PREFIX
private static final char PACKAGE_SEPARATOR
private static final java.lang.String COMMA_SEPARATOR
private static final java.lang.String ARRAY
public static java.lang.String getHumanReadable(IMCMethod method)
public static java.lang.String getHumanReadable(IMCMethod method, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage)
method
- the method to get a string forshowReturnValue
- true
if the return value type should be includedshowReturnValuePackage
- true
if the package name of the return value type should be included. Only
relevant if showReturnValue
is true
.showClassName
- true
if the class name for the method should be includedshowClassPackageName
- true
if the package name of the class for the method should be included.
Only relevant if showClassName
is true
.showArguments
- true
if the class names for the method arguments should be includedshowArgumentsPackage
- true
if the package names of the classes for the method arguments should
be included. Only relevant if showArguments
is true
.public static java.lang.String getPackage(IMCPackage mcPackage)
mcPackage
- package instance to formatpublic static java.lang.String getType(IMCType type, boolean qualified)
type
- type instance to formatqualified
- true
if the returned string should be fully qualifiedprivate static java.lang.String getReturnType(java.lang.String descriptor, boolean qualified) throws java.lang.Exception
java.lang.Exception
private static java.lang.String getParameters(java.lang.String descriptor, boolean qualified) throws java.lang.Exception
java.lang.Exception
private static int parseToken(java.lang.StringBuffer output, java.lang.String input, int position, boolean qualified) throws java.lang.Exception
java.lang.Exception
private static int readArray(java.lang.StringBuffer output, java.lang.String input, int position, boolean qualified) throws java.lang.Exception
java.lang.Exception
private static int readPrimitive(java.lang.StringBuffer output, java.lang.String input, int position, boolean qualified) throws java.lang.Exception
java.lang.Exception
private static int write(java.lang.StringBuffer output, java.lang.String string, int next_position)
private static int readComponentType(java.lang.StringBuffer output, java.lang.String input, int position, boolean qualified)
private static java.lang.String getClass(java.lang.String clazz, boolean qualified)
private static java.lang.String getPrimitiveType(char ch)
public static java.lang.String getHumanReadable(IMCStackTrace trace)
trace
- the stack trace to get a string forpublic static java.lang.String getHumanReadable(IMCStackTrace trace, java.lang.String indent, java.lang.String linePrefix, java.lang.String lineSeparator)
trace
- the stack trace to get a string forindent
- string to use for indentation, defaults to four spaces if parameter is nulllinePrefix
- string to use as a line prefix, defaults to "at " if parameter is null string to
use for indentationlineSeparator
- string to use as line separator, defaults to line separator property if parameter
is nullpublic static java.lang.String getHumanReadable(IMCStackTrace trace, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage, int maximumVisibleStackTraceElements, java.lang.String indent, java.lang.String linePrefix, java.lang.String lineSeparator)
trace
- the stack trace to get a string forshowReturnValue
- true
if the return value type should be includedshowReturnValuePackage
- true
if the package name of the return value type should be included. Only
relevant if showReturnValue
is true
.showClassName
- true
if the class name for the method should be includedshowClassPackageName
- true
if the package name of the class for the method should be included.
Only relevant if showClassName
is true
.showArguments
- true
if the class names for the method arguments should be includedshowArgumentsPackage
- true
if the package names of the classes for the method arguments should
be included. Only relevant if showArguments
is true
.indent
- string to use for indentation, defaults to four spaces if parameter is nulllinePrefix
- string to use as a line prefix, defaults to "at " if parameter is null string to
use for indentationlineSeparator
- string to use as line separator, defaults to line separator property if parameter
is nullpublic static java.lang.String getHumanReadable(IMCClassLoader classLoader)
classLoader
- the classloader to get a string for