DefaultPrettyPrinter.Lf2SpacesIndenter (Jackson-core 2.4.0 API)
Date: 2014-05-29

com.fasterxml.jackson.core.util

## Class DefaultPrettyPrinter.Lf2SpacesIndenter

- java.lang.Object
- - com.fasterxml.jackson.core.util.DefaultPrettyPrinter.NopIndenter
  - - com.fasterxml.jackson.core.util.DefaultPrettyPrinter.Lf2SpacesIndenter

- All Implemented Interfaces:
    DefaultPrettyPrinter.Indenter, Serializable
  Enclosing class:
    DefaultPrettyPrinter

      public static class DefaultPrettyPrinter.Lf2SpacesIndenter
      extends DefaultPrettyPrinter.NopIndenter

  Default linefeed-based indenter uses system-specific linefeeds and 2 spaces for indentation per level.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `_lf` Linefeed used; default value is the platform-specific linefeed.
    `static DefaultPrettyPrinter.Lf2SpacesIndenter` | `instance`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPrettyPrinter.Lf2SpacesIndenter()`
    `DefaultPrettyPrinter.Lf2SpacesIndenter(String lf)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isInline()`
    `DefaultPrettyPrinter.Lf2SpacesIndenter` | `withLinefeed(String lf)` "Mutant factory" method that will return an instance that uses specified String as linefeed.
    `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

    - #### instance

          public static final DefaultPrettyPrinter.Lf2SpacesIndenter instance

    - #### _lf

          protected final String _lf

      Linefeed used; default value is the platform-specific linefeed.

  - ### Constructor Detail

    - #### DefaultPrettyPrinter.Lf2SpacesIndenter

          public DefaultPrettyPrinter.Lf2SpacesIndenter()

    - #### DefaultPrettyPrinter.Lf2SpacesIndenter

          public DefaultPrettyPrinter.Lf2SpacesIndenter(String lf)

      Since:
        2.3

  - ### Method Detail

    - #### withLinefeed

          public DefaultPrettyPrinter.Lf2SpacesIndenter withLinefeed(String lf)

      "Mutant factory" method that will return an instance that uses specified String as linefeed.
      Since:
        2.3

    - #### 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,
                                       JsonGenerationException

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

Copyright © 2014 FasterXML. All Rights Reserved.