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
public class DefaultIndenter
- extends DefaultPrettyPrinter.NopIndenter
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:
- Serialized Form
|
Constructor Summary |
DefaultIndenter()
Indent with two spaces and the system's default line feed |
DefaultIndenter(String indent,
String eol)
Create an indenter which uses the indent string to indent one level
and the eol string to separate lines. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SYS_LF
public static final String SYS_LF
SYSTEM_LINEFEED_INSTANCE
public static final DefaultIndenter SYSTEM_LINEFEED_INSTANCE
DefaultIndenter
public DefaultIndenter()
- Indent with two spaces and the system's default line feed
DefaultIndenter
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.
withLinefeed
public DefaultIndenter withLinefeed(String lf)
withIndent
public DefaultIndenter withIndent(String indent)
isInline
public boolean isInline()
- Specified by:
isInline in interface DefaultPrettyPrinter.Indenter- Overrides:
isInline in class DefaultPrettyPrinter.NopIndenter
- Returns:
- True if indenter is considered inline (does not add linefeeds),
false otherwise
writeIndentation
public void writeIndentation(JsonGenerator jg,
int level)
throws IOException
- Specified by:
writeIndentation in interface DefaultPrettyPrinter.Indenter- Overrides:
writeIndentation in class DefaultPrettyPrinter.NopIndenter
- Throws:
IOException
getEol
public String getEol()
getIndent
public String getIndent()
Copyright © 2008-2016 FasterXML. All Rights Reserved.