Package com.fasterxml.jackson.core.util
Class DefaultIndenter
java.lang.Object
com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter
com.fasterxml.jackson.core.util.DefaultIndenter
- All Implemented Interfaces:
DefaultPrettyPrinter.Indenter
,Serializable
Default linefeed-based indenter, used by
DefaultPrettyPrinter
(unless
overridden). Uses system-specific linefeeds and 2 spaces for indentation per level.- Since:
- 2.5
- See Also:
-
Field Summary
Fields inherited from class com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter
instance
-
Constructor Summary
ConstructorDescriptionIndent with two spaces and the system's default line feedDefaultIndenter
(String indent, String eol) Create an indenter which uses theindent
string to indent one level and theeol
string to separate lines. -
Method Summary
Modifier and TypeMethodDescriptiongetEol()
boolean
isInline()
withIndent
(String indent) withLinefeed
(String lf) void
writeIndentation
(JsonGenerator jg, int level)
-
Field Details
-
SYS_LF
-
SYSTEM_LINEFEED_INSTANCE
-
-
Constructor Details
-
DefaultIndenter
public DefaultIndenter()Indent with two spaces and the system's default line feed -
DefaultIndenter
Create an indenter which uses theindent
string to indent one level and theeol
string to separate lines.- Parameters:
indent
- Indentation String to prepend for a single level of indentationeol
- End-of-line marker to use after indented line
-
-
Method Details
-
withLinefeed
-
withIndent
-
isInline
public boolean isInline()- Specified by:
isInline
in interfaceDefaultPrettyPrinter.Indenter
- Overrides:
isInline
in classDefaultPrettyPrinter.NopIndenter
- Returns:
- True if indenter is considered inline (does not add linefeeds), false otherwise
-
writeIndentation
- Specified by:
writeIndentation
in interfaceDefaultPrettyPrinter.Indenter
- Overrides:
writeIndentation
in classDefaultPrettyPrinter.NopIndenter
- Throws:
IOException
-
getEol
-
getIndent
-