java.lang.Object |
↳ |
com.pnfsoftware.jeb.util.format.PrettyPrinter |
Class Overview
The pretty-printer object does its best to provide a human-readable representation of any object.
Elements of arrays, collections, and maps are rendered individually. For non-basic types,
toString
is called, unless forbidden (see `allowCallToString`) or customized (see
formatObject(Object)
). For maps, the key-value pairs are rendered one per line line.
Indenting uses 2 white-space characters.
Summary
Protected Methods |
String
|
formatObject(Object o)
Subclasses can provide custom formatting for the given object.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Constants
public
static
final
int
DEFAULT_MAX_ARRAY_ITEM_COUNT
Constant Value:
40
(0x00000028)
public
static
final
int
DEFAULT_MAX_COLLECTION_ITEM_COUNT
Constant Value:
40
(0x00000028)
public
static
final
int
DEFAULT_MAX_MAP_ITEM_COUNT
Constant Value:
40
(0x00000028)
public
static
final
int
DEFAULT_MAX_STRING_LENGTH
Constant Value:
200
(0x000000c8)
Public Constructors
public
PrettyPrinter
(boolean allowUnsafeCalls, int indentStringLength)
public
PrettyPrinter
(boolean allowUnsafeCalls)
Public Methods
public
String
format
(Object o)
public
void
setMaxArrayLength
(int max)
public
void
setMaxCollectionLength
(int max)
public
void
setMaxMapLength
(int max)
public
void
setMaxStringLength
(int max)
Protected Methods
protected
String
formatObject
(Object o)
Subclasses can provide custom formatting for the given object.
Returns
- a string or null to let the pretty-printer proceed with its own implementation