Example usage for com.fasterxml.jackson.core.util DefaultIndenter DefaultIndenter

List of usage examples for com.fasterxml.jackson.core.util DefaultIndenter DefaultIndenter

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core.util DefaultIndenter DefaultIndenter.

Prototype

public DefaultIndenter() 

Source Link

Document

Indent with two spaces and the system's default line feed

Usage

From source file:craterdog.smart.SmartObjectMapper.java

/**
 * This method overrides the same method in the super class and returns a better
 * pretty printer implementation.  NOTE: This looks like it would set the default
 * pretty printer for all uses by the object mapper but it does NOT.  I think this
 * is a case of the original intent changing or being lost over time.  There is an
 * enhancement request to address this problem, for more details see:
 * https://github.com/FasterXML/jackson-databind/issues/689.
 *
 * @return The better pretty printer to be used to format the JSON output.
 *///  w ww. ja va  2 s.c om
@Override
protected PrettyPrinter _defaultPrettyPrinter() {
    return new BetterPrettyPrinter().withArrayIndenter(new DefaultIndenter());
}

From source file:craterdog.smart.SmartObjectMapper.java

/**
 * This method behaves similarly to the <code>_defaultPrettyPrinter()</code> method
 * except that it includes an indentation prefix that will be prepended to each line of the
 * resulting string (except the first line).
 *
 * @param indentation The indentation string to be prepended to each line.
 * @return The better pretty printer to be used to format the JSON output.
 *//*from w ww.  j a va  2 s  .  co  m*/
protected PrettyPrinter _defaultPrettyPrinter(String indentation) {
    return new BetterPrettyPrinter(indentation).withArrayIndenter(new DefaultIndenter());
}