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
FieldsFields inherited from class com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter
instance -
Constructor Summary
ConstructorsConstructorDescriptionIndent with two spaces and the system's default line feedDefaultIndenter(String indent, String eol) Create an indenter which uses theindentstring to indent one level and theeolstring to separate lines. -
Method Summary
Modifier and TypeMethodDescriptiongetEol()booleanisInline()withIndent(String indent) withLinefeed(String lf) voidwriteIndentation(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 theindentstring to indent one level and theeolstring 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:
isInlinein interfaceDefaultPrettyPrinter.Indenter- Overrides:
isInlinein classDefaultPrettyPrinter.NopIndenter- Returns:
- True if indenter is considered inline (does not add linefeeds), false otherwise
-
writeIndentation
- Specified by:
writeIndentationin interfaceDefaultPrettyPrinter.Indenter- Overrides:
writeIndentationin classDefaultPrettyPrinter.NopIndenter- Throws:
IOException
-
getEol
-
getIndent
-