DefaultIndenter
Date: 2016-12-03

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 by `DefaultPrettyPrinter` (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 and 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 and Description
    `DefaultIndenter()` Indent with two spaces and the system's default line feed
    `DefaultIndenter(java.lang.String indent, java.lang.String eol)` Create an indenter which uses the `indent` string to indent one level and the `eol` string to separate lines.

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 the `indent` string to indent one level and the `eol` string to separate lines.

  - ### 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 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 java.io.IOException

      Specified by:
        `writeIndentation` in interface `DefaultPrettyPrinter.Indenter`
      Overrides:
        `writeIndentation` in class `DefaultPrettyPrinter.NopIndenter`
      Throws:
        `java.io.IOException`

    - #### getEol

          public java.lang.String getEol()

    - #### getIndent

          public java.lang.String getIndent()