程序包 | 说明 |
---|---|
org.codehaus.jackson |
Main public API classes of the core streaming JSON
processor: most importantly
JsonFactory
used for constructing
JSON parser (JsonParser )
and generator
(JsonParser )
instances. |
org.codehaus.jackson.map |
Contains basic mapper (conversion) functionality that
allows for converting between regular streaming json content and
Java objects (beans or Tree Model: support for both is via
ObjectMapper class, as well
as convenience methods included in
JsonParser
Object mapper will convert Json content to ant from
basic Java wrapper types (Integer, Boolean, Double),
Collection types (List, Map), Java Beans,
Strings and nulls. |
org.codehaus.jackson.smile |
Package that contains experimental implementation of
"Binary-Encoded JSON-Like" data format handlers (parser,
generator, factory produce both, supporting constants).
|
org.codehaus.jackson.util |
Utility classes used by Jackson Core functionality.
|
限定符和类型 | 字段和说明 |
---|---|
protected PrettyPrinter |
JsonGenerator._cfgPrettyPrinter
Object that handles pretty-printing (usually additional
white space to make results more human-readable) during
output.
|
限定符和类型 | 方法和说明 |
---|---|
JsonGenerator |
JsonGenerator.setPrettyPrinter(PrettyPrinter pp)
Method for setting a custom pretty printer, which is usually
used to add indentation for improved human readability.
|
限定符和类型 | 字段和说明 |
---|---|
protected PrettyPrinter |
ObjectWriter._prettyPrinter
To allow for dynamic enabling/disabling of pretty printing,
pretty printer can be optionally configured for writer
as well
|
protected static PrettyPrinter |
ObjectWriter.NULL_PRETTY_PRINTER
We need to keep track of explicit disabling of pretty printing;
easiest to do by a token value.
|
限定符和类型 | 方法和说明 |
---|---|
protected PrettyPrinter |
ObjectMapper._defaultPrettyPrinter()
Helper method that should return default pretty-printer to
use for generators constructed by this mapper, when instructed
to use default pretty printer.
|
限定符和类型 | 方法和说明 |
---|---|
ObjectWriter |
ObjectMapper.prettyPrintingWriter(PrettyPrinter pp)
已过时。
Since 1.9, use
ObjectMapper.writer(FilterProvider) instead. |
ObjectWriter |
ObjectWriter.withPrettyPrinter(PrettyPrinter pp)
Method that will construct a new instance that will use specified pretty
printer (or, if null, will not do any pretty-printing)
|
ObjectWriter |
ObjectMapper.writer(PrettyPrinter pp)
Factory method for constructing
ObjectWriter that will
serialize objects using specified pretty printer for indentation
(or if null, no pretty printer) |
构造器和说明 |
---|
ObjectWriter(ObjectMapper mapper,
SerializationConfig config,
JavaType rootType,
PrettyPrinter pp)
Constructor used by
ObjectMapper for initial instantiation |
ObjectWriter(ObjectWriter base,
SerializationConfig config,
JavaType rootType,
PrettyPrinter pp,
FormatSchema s)
Copy constructor used for building variations.
|
限定符和类型 | 方法和说明 |
---|---|
JsonGenerator |
SmileGenerator.setPrettyPrinter(PrettyPrinter pp)
No way (or need) to indent anything, so let's block any attempts.
|
限定符和类型 | 类和说明 |
---|---|
class |
DefaultPrettyPrinter
Default
PrettyPrinter implementation that uses 2-space
indentation with platform-default linefeeds. |
class |
MinimalPrettyPrinter
PrettyPrinter implementation that adds no indentation,
just implements everything necessary for value output to work
as expected, and provide simpler extension points to allow
for creating simple custom implementations that add specific
decoration or overrides. |