# Class: com.pnfsoftware.jeb.util.format.PrettyPrinter

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)](#formatObject(Object))\). For maps, the key\-value pairs are rendered one per line line. Indenting uses 2 white\-space characters.

## Constructor: PrettyPrinter
- parameter: `allowUnsafeCalls`, type: `boolean`
- parameter: `indentStringLength`, type: `int`

Description: Create a pretty\-printer.
parameter: allowUnsafeCalls: true to allow calls to arbitrary `toString`, collection, and            map methods
parameter: indentStringLength: number of spaces used for one indentation level; a negative value            disables multi\-line map rendering

## Constructor: PrettyPrinter
- parameter: `allowUnsafeCalls`, type: `boolean`

Description: Create a pretty\-printer using two\-space indentation.
parameter: allowUnsafeCalls: true to allow calls to arbitrary `toString`, collection, and            map methods

## Constructor: PrettyPrinter

Description: Create a pretty\-printer allowing arbitrary object formatting calls.

## Static Field: DEFAULT_MAX_ARRAY_ITEM_COUNT
Type: `int`

Constant value: `40`
Description: Default maximum number of items rendered for arrays.

## Static Field: DEFAULT_MAX_COLLECTION_ITEM_COUNT
Type: `int`

Constant value: `40`
Description: Default maximum number of items rendered for collections.

## Static Field: DEFAULT_MAX_MAP_ITEM_COUNT
Type: `int`

Constant value: `40`
Description: Default maximum number of entries rendered for maps.

## Static Field: DEFAULT_MAX_STRING_LENGTH
Type: `int`

Constant value: `200`
Description: Default maximum number of characters rendered for strings.

## Method: format
- parameter: `o`, type: `java.lang.Object`
- return type: `java.lang.String`

Description: Format an object.
parameter: o: object to format
return: a human\-readable representation

## Protected Method: formatObject
- parameter: `o`, type: `java.lang.Object`
- return type: `java.lang.String`

Description: Subclasses can provide custom formatting for the given object.
parameter: o: object to format
return: a string or null to let the pretty\-printer proceed with its own implementation

## Method: setMaxArrayLength
- parameter: `max`, type: `int`

Description: Set the maximum number of items rendered for arrays.
parameter: max: maximum array item count

## Method: setMaxCollectionLength
- parameter: `max`, type: `int`

Description: Set the maximum number of items rendered for collections.
parameter: max: maximum collection item count

## Method: setMaxMapLength
- parameter: `max`, type: `int`

Description: Set the maximum number of entries rendered for maps.
parameter: max: maximum map entry count

## Method: setMaxStringLength
- parameter: `max`, type: `int`

Description: Set the maximum number of characters rendered for strings.
parameter: max: maximum string length

