Package org.openjdk.jmc.common.util
Class FormatToolkit
- java.lang.Object
- 
- org.openjdk.jmc.common.util.FormatToolkit
 
- 
 public class FormatToolkit extends Object Methods for formatting IMC* instances.
- 
- 
Constructor SummaryConstructors Constructor Description FormatToolkit()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetHumanReadable(IMCClassLoader classLoader)Get a human readable string representing a classloader.static StringgetHumanReadable(IMCMethod method)Get a human readable string representing a method, displays all available informationstatic StringgetHumanReadable(IMCMethod method, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage)Get a human readable string representing a method.static StringgetHumanReadable(IMCMethod method, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage, boolean showModifiers)Get a human readable string representing a method.static StringgetHumanReadable(IMCStackTrace trace)Get a human readable string representing a stack trace, displays all available information.static StringgetHumanReadable(IMCStackTrace trace, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage, int maximumVisibleStackTraceElements, String indent, String linePrefix, String lineSeparator)Get a human readable string representing a stack trace.static StringgetHumanReadable(IMCStackTrace trace, String indent, String linePrefix, String lineSeparator)Get a human readable string representing a stack trace, displays all available information.static StringgetPackage(IMCPackage mcPackage)Get the package name as a human readable string.static StringgetType(IMCType type, boolean qualified)Get the type name as a human readable string.
 
- 
- 
- 
Method Detail- 
getHumanReadablepublic static String getHumanReadable(IMCMethod method) Get a human readable string representing a method, displays all available information- Returns:
- a human readable string representing the method
 
 - 
getHumanReadablepublic static String getHumanReadable(IMCMethod method, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage) Get a human readable string representing a method.- Parameters:
- method- the method to get a string for
- showReturnValue-- trueif the return value type should be included
- showReturnValuePackage-- trueif the package name of the return value type should be included. Only relevant if- showReturnValueis- true.
- showClassName-- trueif the class name for the method should be included
- showClassPackageName-- trueif the package name of the class for the method should be included. Only relevant if- showClassNameis- true.
- showArguments-- trueif the class names for the method arguments should be included
- showArgumentsPackage-- trueif the package names of the classes for the method arguments should be included. Only relevant if- showArgumentsis- true.
- Returns:
- a human readable string representing the method
 
 - 
getHumanReadablepublic static String getHumanReadable(IMCMethod method, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage, boolean showModifiers) Get a human readable string representing a method.- Parameters:
- method- the method to get a string for
- showReturnValue-- trueif the return value type should be included
- showReturnValuePackage-- trueif the package name of the return value type should be included. Only relevant if- showReturnValueis- true.
- showClassName-- trueif the class name for the method should be included
- showClassPackageName-- trueif the package name of the class for the method should be included. Only relevant if- showClassNameis- true.
- showArguments-- trueif the class names for the method arguments should be included
- showArgumentsPackage-- trueif the package names of the classes for the method arguments should be included. Only relevant if- showArgumentsis- true.
- showModifiers-- trueif the modifiers for the method should be included. Only relevant if- showModifiersis- true.
- Returns:
- a human readable string representing the method
 
 - 
getPackagepublic static String getPackage(IMCPackage mcPackage) Get the package name as a human readable string. If it is the default package (the empty string), then get a describing text for that.- Parameters:
- mcPackage- package instance to format
- Returns:
- the package name
 
 - 
getTypepublic static String getType(IMCType type, boolean qualified) Get the type name as a human readable string.- Parameters:
- type- type instance to format
- qualified-- trueif the returned string should be fully qualified
- Returns:
- the type name, fully qualified if requested so
 
 - 
getHumanReadablepublic static String getHumanReadable(IMCStackTrace trace) Get a human readable string representing a stack trace, displays all available information.- Parameters:
- trace- the stack trace to get a string for
- Returns:
- a human readable string representing the stack trace
 
 - 
getHumanReadablepublic static String getHumanReadable(IMCStackTrace trace, String indent, String linePrefix, String lineSeparator) Get a human readable string representing a stack trace, displays all available information.- Parameters:
- trace- the stack trace to get a string for
- indent- string to use for indentation, defaults to four spaces if parameter is null
- linePrefix- string to use as a line prefix, defaults to "at " if parameter is null string to use for indentation
- lineSeparator- string to use as line separator, defaults to line separator property if parameter is null
- Returns:
- a human readable string representing the stack trace
 
 - 
getHumanReadablepublic static String getHumanReadable(IMCStackTrace trace, boolean showReturnValue, boolean showReturnValuePackage, boolean showClassName, boolean showClassPackageName, boolean showArguments, boolean showArgumentsPackage, int maximumVisibleStackTraceElements, String indent, String linePrefix, String lineSeparator) Get a human readable string representing a stack trace.- Parameters:
- trace- the stack trace to get a string for
- showReturnValue-- trueif the return value type should be included
- showReturnValuePackage-- trueif the package name of the return value type should be included. Only relevant if- showReturnValueis- true.
- showClassName-- trueif the class name for the method should be included
- showClassPackageName-- trueif the package name of the class for the method should be included. Only relevant if- showClassNameis- true.
- showArguments-- trueif the class names for the method arguments should be included
- showArgumentsPackage-- trueif the package names of the classes for the method arguments should be included. Only relevant if- showArgumentsis- true.
- indent- string to use for indentation, defaults to four spaces if parameter is null
- linePrefix- string to use as a line prefix, defaults to "at " if parameter is null string to use for indentation
- lineSeparator- string to use as line separator, defaults to line separator property if parameter is null
- Returns:
- a human readable string representing the stack trace
 
 - 
getHumanReadablepublic static String getHumanReadable(IMCClassLoader classLoader) Get a human readable string representing a classloader.- Parameters:
- classLoader- the classloader to get a string for
- Returns:
- a human readable string representing the classloader
 
 
- 
 
-