Top Description Fields Constructors Methods
com.fasterxml.jackson.core.util

public Class DefaultIndenter

extends NopIndenter
Class Inheritance
Imports
java.io.IOException, com.fasterxml.jackson.core.JsonGenerator

Default linefeed-based indenter, used by DefaultPrettyPrinter (unless overridden). Uses system-specific linefeeds and 2 spaces for indentation per level.
Since
2.5

Field Summary

Modifier and TypeField and Description
private final int
private final String
private static final int
INDENT_LEVELS

We expect to rarely get indentation deeper than this number of levels, and try not to pre-generate more indentations than needed.

private final char[]
private static final long
public static final String
public static final DefaultIndenter
Inherited from com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter:
instance

Constructor Summary

AccessConstructor and Description
public
DefaultIndenter()

Indent with two spaces and the system's default line feed

public
DefaultIndenter(String
Indentation String to prepend for a single level of indentation
indent
,
String
End-of-line marker to use after indented line
eol
)

Create an indenter which uses the indent string to indent one level and the eol string to separate lines.

Method Summary

Modifier and TypeMethod and Description
public String
public String
public boolean
public DefaultIndenter
public DefaultIndenter
public void

Field Detail

charsPerLevelback to summary
private final int charsPerLevel
eolback to summary
private final String eol
INDENT_LEVELSback to summary
private static final int INDENT_LEVELS

We expect to rarely get indentation deeper than this number of levels, and try not to pre-generate more indentations than needed.

indentsback to summary
private final char[] indents
serialVersionUIDback to summary
private static final long serialVersionUID
SYS_LFback to summary
public static final String SYS_LF
SYSTEM_LINEFEED_INSTANCEback to summary
public static final DefaultIndenter SYSTEM_LINEFEED_INSTANCE

Constructor Detail

DefaultIndenterback to summary
public DefaultIndenter()

Indent with two spaces and the system's default line feed

DefaultIndenterback to summary
public DefaultIndenter(String indent, String eol)

Create an indenter which uses the indent string to indent one level and the eol string to separate lines.

Parameters
indent:String

Indentation String to prepend for a single level of indentation

eol:String

End-of-line marker to use after indented line

Method Detail

getEolback to summary
public String getEol()
getIndentback to summary
public String getIndent()
isInlineback to summary
public boolean isInline()

Overrides com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter.isInline.

Implements com.fasterxml.jackson.core.util.DefaultPrettyPrinter.Indenter.isInline.

Returns:boolean

Doc from com.fasterxml.jackson.core.util.DefaultPrettyPrinter.Indenter.isInline.

True if indenter is considered inline (does not add linefeeds), false otherwise

Annotations
@Override
withIndentback to summary
public DefaultIndenter withIndent(String indent)
withLinefeedback to summary
public DefaultIndenter withLinefeed(String lf)
writeIndentationback to summary
public void writeIndentation(JsonGenerator jg, int level) throws IOException

Overrides com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter.writeIndentation.

Implements com.fasterxml.jackson.core.util.DefaultPrettyPrinter.Indenter.writeIndentation.

Annotations
@Override