public final class PrettyPrinter extends Object
format(String, Object...)
acts like String.format(java.lang.String, java.lang.Object...)
, except
that it detects and pretty-prints the following argument types:
Class
: formatted as "org.example.Class$SubClass"Key
: formatted as "@org.example.Annotation org.example.Class$SubClass"List
: formatted as a dependency path preceded by a newline. If
the path begins at Dependency.GINJECTOR
, that key is hidden, and the context
of the outgoing dependency is given as the context of the first key in the displayed
path.String.format(java.lang.String, java.lang.Object...)
.Modifier and Type | Method and Description |
---|---|
static String |
format(String formatString,
Object... args)
Generate a string based on a format template as
String.format(java.lang.String, java.lang.Object...)
would, using the pretty-printing rules specified in the class
documentation. |
static void |
log(TreeLogger logger,
TreeLogger.Type type,
String formatString,
Object... args)
Log a pretty-printed message if the given log level is active.
|
public static void log(TreeLogger logger, TreeLogger.Type type, String formatString, Object... args)
public static String format(String formatString, Object... args)
String.format(java.lang.String, java.lang.Object...)
would, using the pretty-printing rules specified in the class
documentation.Copyright © 2008–2018. All rights reserved.