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
,java.io.Serializable
public class DefaultIndenter extends DefaultPrettyPrinter.NopIndenter
Default linefeed-based indenter, used byDefaultPrettyPrinter
(unless overridden). Uses system-specific linefeeds and 2 spaces for indentation per level.- Since:
- 2.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SYS_LF
static DefaultIndenter
SYSTEM_LINEFEED_INSTANCE
-
Fields inherited from class com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter
instance
-
-
Constructor Summary
Constructors Constructor Description DefaultIndenter()
Indent with two spaces and the system's default line feedDefaultIndenter(java.lang.String indent, java.lang.String eol)
Create an indenter which uses theindent
string to indent one level and theeol
string to separate lines.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEol()
java.lang.String
getIndent()
boolean
isInline()
DefaultIndenter
withIndent(java.lang.String indent)
DefaultIndenter
withLinefeed(java.lang.String lf)
void
writeIndentation(JsonGenerator jg, int level)
-
-
-
Field Detail
-
SYS_LF
public static final java.lang.String SYS_LF
-
SYSTEM_LINEFEED_INSTANCE
public static final DefaultIndenter SYSTEM_LINEFEED_INSTANCE
-
-
Constructor Detail
-
DefaultIndenter
public DefaultIndenter()
Indent with two spaces and the system's default line feed
-
DefaultIndenter
public DefaultIndenter(java.lang.String indent, java.lang.String eol)
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 Detail
-
withLinefeed
public DefaultIndenter withLinefeed(java.lang.String lf)
-
withIndent
public DefaultIndenter withIndent(java.lang.String indent)
-
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
public void writeIndentation(JsonGenerator jg, int level) throws java.io.IOException
- Specified by:
writeIndentation
in interfaceDefaultPrettyPrinter.Indenter
- Overrides:
writeIndentation
in classDefaultPrettyPrinter.NopIndenter
- Throws:
java.io.IOException
-
getEol
public java.lang.String getEol()
-
getIndent
public java.lang.String getIndent()
-
-