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
  Direct Known Subclasses:
    DefaultPrettyPrinter.Lf2SpacesIndenter

      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 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(String indent, 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
    --- | ---
    `String` | `getEol()`
    `String` | `getIndent()`
    `boolean` | `isInline()`
    `DefaultIndenter` | `withIndent(String indent)`
    `DefaultIndenter` | `withLinefeed(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 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(String indent,
                         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(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 © 2014-2015 FasterXML. All Rights Reserved.