public final class JacksonFactory extends JsonFactory
Implementation is thread-safe, and sub-classes must be thread-safe. For maximum efficiency, applications should use a single globally-shared instance of the JSON factory.
Constructor and Description |
---|
JacksonFactory() |
Modifier and Type | Method and Description |
---|---|
JsonGenerator |
createJsonGenerator(OutputStream out,
Charset enc)
Returns a new instance of a low-level JSON serializer for the given output stream and encoding.
|
JsonGenerator |
createJsonGenerator(Writer writer)
Returns a new instance of a low-level JSON serializer for the given writer.
|
JsonParser |
createJsonParser(InputStream in)
Returns a new instance of a low-level JSON parser for the given input stream.
|
JsonParser |
createJsonParser(InputStream in,
Charset charset)
Returns a new instance of a low-level JSON parser for the given input stream.
|
JsonParser |
createJsonParser(Reader reader)
Returns a new instance of a low-level JSON parser for the given reader.
|
JsonParser |
createJsonParser(String value)
Returns a new instance of a low-level JSON parser for the given string value.
|
static JacksonFactory |
getDefaultInstance()
Returns a global thread-safe instance.
|
createJsonObjectParser, fromInputStream, fromInputStream, fromReader, fromString, toByteArray, toPrettyString, toString
public static JacksonFactory getDefaultInstance()
public JsonGenerator createJsonGenerator(OutputStream out, Charset enc) throws IOException
JsonFactory
createJsonGenerator
in class JsonFactory
out
- output streamenc
- encodingIOException
public JsonGenerator createJsonGenerator(Writer writer) throws IOException
JsonFactory
createJsonGenerator
in class JsonFactory
writer
- writerIOException
public JsonParser createJsonParser(Reader reader) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
reader
- readerIOException
public JsonParser createJsonParser(InputStream in) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
in
- input streamIOException
public JsonParser createJsonParser(InputStream in, Charset charset) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
in
- input streamcharset
- charset in which the input stream is encoded or null
to let the parser
detect the charsetIOException
public JsonParser createJsonParser(String value) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
value
- string valueIOException
Copyright © 2011–2019 Google. All rights reserved.