Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.inject.rebind.util
Class PrettyPrinter

    java.lang.Object
      com.google.gwt.inject.rebind.util.PrettyPrinter

    public final class PrettyPrinter

extends java.lang.Object

Pretty-printer that formats internal types for human consumption in error messages.

`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.

All other arguments are passed unchanged to `String.format(java.lang.String, java.lang.Object...)`.

Method Summary
`static java.lang.String` | `format(java.lang.String formatString, java.lang.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(com.google.gwt.core.ext.TreeLogger logger, com.google.gwt.core.ext.TreeLogger.Type type, java.lang.String formatString, java.lang.Object... args)` Log a pretty-printed message if the given log level is active.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### log

    public static void log(com.google.gwt.core.ext.TreeLogger logger,
                           com.google.gwt.core.ext.TreeLogger.Type type,
                           java.lang.String formatString,
                           java.lang.Object... args)

  Log a pretty-printed message if the given log level is active. The message is only formatted if it will be logged.

### format

    public static java.lang.String format(java.lang.String formatString,
                                          java.lang.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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD