public class JsonFactory extends TokenStreamFactory implements Versioned, java.io.Serializable
JsonParser
)
and writer (aka generator, JsonGenerator
)
instances.
Factory instances are thread-safe and reusable after configuration (if any). Typically applications and services use only a single globally shared factory instance, unless they need differently configured factories. Factory reuse is important if efficiency matters; most recycling of expensive construct is done on per-factory basis.
Creation of a factory instance is a light-weight operation, and since there is no need for pluggable alternative implementations (as there is no "standard" JSON processor API to implement), the default constructor is used for constructing factory instances.
Modifier and Type | Class and Description |
---|---|
static class |
JsonFactory.Feature
Enumeration that defines all on/off features that can only be
changed for
JsonFactory . |
Modifier and Type | Field and Description |
---|---|
static char |
DEFAULT_QUOTE_CHAR |
static SerializableString |
DEFAULT_ROOT_VALUE_SEPARATOR |
static java.lang.String |
FORMAT_NAME_JSON
Name used to identify JSON format
(and returned by
getFormatName() |
Constructor and Description |
---|
JsonFactory()
Default constructor used to create factory instances.
|
JsonFactory(JsonFactoryBuilder b)
Constructor used by
JsonFactoryBuilder for instantiation. |
JsonFactory(ObjectCodec oc) |
Modifier and Type | Method and Description |
---|---|
BufferRecycler |
_getBufferRecycler()
Method used by factory to create buffer recycler instances
for parsers and generators.
|
static TSFBuilder<?,?> |
builder()
Main factory method to use for constructing
JsonFactory instances with
different configuration: creates and returns a builder for collecting configuration
settings; instance created by calling build() after all configuration
set. |
boolean |
canHandleBinaryNatively()
Introspection method that higher-level functionality may call
to see whether underlying data format can read and write binary
data natively; that is, embeded it as-is without using encodings
such as Base64.
|
boolean |
canParseAsync()
Introspection method that can be used to check whether this
factory can create non-blocking parsers: parsers that do not
use blocking I/O abstractions but instead use a
NonBlockingInputFeeder . |
boolean |
canUseCharArrays()
Introspection method that can be used by base factory to check
whether access using
char[] is something that actual
parser implementations can take advantage of, over having to
use Reader . |
boolean |
canUseSchema(FormatSchema schema)
Method that can be used to quickly check whether given schema
is something that parsers and/or generators constructed by this
factory could use.
|
JsonFactory |
configure(JsonFactory.Feature f,
boolean state)
Deprecated.
since 2.10 use
TSFBuilder.configure(JsonFactory.Feature, boolean) instead |
JsonFactory |
configure(JsonGenerator.Feature f,
boolean state)
Method for enabling or disabling specified generator feature
(check
JsonGenerator.Feature for list of features) |
JsonFactory |
configure(JsonParser.Feature f,
boolean state)
Method for enabling or disabling specified parser feature
(check
JsonParser.Feature for list of features) |
JsonFactory |
copy()
Method for constructing a new
JsonFactory that has
the same settings as this instance, but is otherwise
independent (i.e. |
JsonGenerator |
createGenerator(java.io.DataOutput out)
Convenience method for constructing generator that uses default
encoding of the format (UTF-8 for JSON and most other data formats).
|
JsonGenerator |
createGenerator(java.io.DataOutput out,
JsonEncoding enc)
Method for constructing generator for writing content using specified
DataOutput instance. |
JsonGenerator |
createGenerator(java.io.File f,
JsonEncoding enc)
Method for constructing JSON generator for writing JSON content
to specified file, overwriting contents it might have (or creating
it if such file does not yet exist).
|
JsonGenerator |
createGenerator(java.io.OutputStream out)
Convenience method for constructing generator that uses default
encoding of the format (UTF-8 for JSON and most other data formats).
|
JsonGenerator |
createGenerator(java.io.OutputStream out,
JsonEncoding enc)
Method for constructing JSON generator for writing JSON content
using specified output stream.
|
JsonGenerator |
createGenerator(java.io.Writer w)
Method for constructing JSON generator for writing JSON content
using specified Writer.
|
JsonGenerator |
createJsonGenerator(java.io.OutputStream out)
Deprecated.
Since 2.2, use
createGenerator(OutputStream) instead. |
JsonGenerator |
createJsonGenerator(java.io.OutputStream out,
JsonEncoding enc)
Deprecated.
Since 2.2, use
createGenerator(OutputStream, JsonEncoding) instead. |
JsonGenerator |
createJsonGenerator(java.io.Writer out)
Deprecated.
Since 2.2, use
createGenerator(Writer) instead. |
JsonParser |
createJsonParser(byte[] data)
Deprecated.
Since 2.2, use
createParser(byte[]) instead. |
JsonParser |
createJsonParser(byte[] data,
int offset,
int len)
Deprecated.
Since 2.2, use
createParser(byte[],int,int) instead. |
JsonParser |
createJsonParser(java.io.File f)
Deprecated.
Since 2.2, use
createParser(File) instead. |
JsonParser |
createJsonParser(java.io.InputStream in)
Deprecated.
Since 2.2, use
createParser(InputStream) instead. |
JsonParser |
createJsonParser(java.io.Reader r)
Deprecated.
Since 2.2, use
createParser(Reader) instead. |
JsonParser |
createJsonParser(java.lang.String content)
Deprecated.
Since 2.2, use
createParser(String) instead. |
JsonParser |
createJsonParser(java.net.URL url)
Deprecated.
Since 2.2, use
createParser(URL) instead. |
JsonParser |
createNonBlockingByteArrayParser()
Optional method for constructing parser for non-blocking parsing
via
ByteArrayFeeder
interface (accessed using JsonParser.getNonBlockingInputFeeder()
from constructed instance). |
JsonParser |
createParser(byte[] data)
Method for constructing parser for parsing
the contents of given byte array.
|
JsonParser |
createParser(byte[] data,
int offset,
int len)
Method for constructing parser for parsing
the contents of given byte array.
|
JsonParser |
createParser(char[] content)
Method for constructing parser for parsing
contents of given char array.
|
JsonParser |
createParser(char[] content,
int offset,
int len)
Method for constructing parser for parsing contents of given char array.
|
JsonParser |
createParser(java.io.DataInput in)
Optional method for constructing parser for reading contents from specified
DataInput
instance. |
JsonParser |
createParser(java.io.File f)
Method for constructing JSON parser instance to parse
contents of specified file.
|
JsonParser |
createParser(java.io.InputStream in)
Method for constructing JSON parser instance to parse
the contents accessed via specified input stream.
|
JsonParser |
createParser(java.io.Reader r)
Method for constructing parser for parsing
the contents accessed via specified Reader.
|
JsonParser |
createParser(java.lang.String content)
Method for constructing parser for parsing
contents of given String.
|
JsonParser |
createParser(java.net.URL url)
Method for constructing JSON parser instance to parse
contents of resource reference by given URL.
|
JsonFactory |
disable(JsonFactory.Feature f)
Deprecated.
since 2.10 use
TSFBuilder.configure(JsonFactory.Feature, boolean) instead |
JsonFactory |
disable(JsonGenerator.Feature f)
Method for disabling specified generator feature
(check
JsonGenerator.Feature for list of features) |
JsonFactory |
disable(JsonParser.Feature f)
Method for disabling specified parser features
(check
JsonParser.Feature for list of features) |
JsonFactory |
enable(JsonFactory.Feature f)
Deprecated.
since 2.10 use
TSFBuilder.configure(JsonFactory.Feature, boolean) instead |
JsonFactory |
enable(JsonGenerator.Feature f)
Method for enabling specified generator features
(check
JsonGenerator.Feature for list of features) |
JsonFactory |
enable(JsonParser.Feature f)
Method for enabling specified parser feature
(check
JsonParser.Feature for list of features) |
CharacterEscapes |
getCharacterEscapes()
Method for accessing custom escapes factory uses for
JsonGenerator s
it creates. |
ObjectCodec |
getCodec() |
int |
getFormatGeneratorFeatures() |
java.lang.String |
getFormatName()
Method that returns short textual id identifying format
this factory supports.
|
int |
getFormatParserFeatures() |
java.lang.Class<? extends FormatFeature> |
getFormatReadFeatureType()
Method for accessing kind of
FormatFeature that a parser
JsonParser produced by this factory would accept, if any;
null returned if none. |
java.lang.Class<? extends FormatFeature> |
getFormatWriteFeatureType()
Method for accessing kind of
FormatFeature that a parser
JsonGenerator produced by this factory would accept, if any;
null returned if none. |
int |
getGeneratorFeatures() |
InputDecorator |
getInputDecorator()
Method for getting currently configured input decorator (if any;
there is no default decorator).
|
OutputDecorator |
getOutputDecorator()
Method for getting currently configured output decorator (if any;
there is no default decorator).
|
int |
getParserFeatures() |
java.lang.String |
getRootValueSeparator() |
MatchStrength |
hasFormat(InputAccessor acc)
Convenience method for trying to determine whether input via given accessor
is of format type supported by this factory.
|
boolean |
isEnabled(JsonFactory.Feature f)
Checked whether specified parser feature is enabled.
|
boolean |
isEnabled(JsonGenerator.Feature f)
Check whether specified generator feature is enabled.
|
boolean |
isEnabled(JsonParser.Feature f)
Checked whether specified parser feature is enabled.
|
boolean |
isEnabled(StreamReadFeature f) |
boolean |
isEnabled(StreamWriteFeature f) |
TSFBuilder<?,?> |
rebuild()
Method that allows construction of differently configured factory, starting
with settings of this factory.
|
boolean |
requiresCustomCodec()
Method that can be called to determine if a custom
ObjectCodec is needed for binding data parsed
using JsonParser constructed by this factory
(which typically also implies the same for serialization
with JsonGenerator ). |
boolean |
requiresPropertyOrdering()
Introspection method that higher-level functionality may call
to see whether underlying data format requires a stable ordering
of object properties or not.
|
JsonFactory |
setCharacterEscapes(CharacterEscapes esc)
Method for defining custom escapes factory uses for
JsonGenerator s
it creates. |
JsonFactory |
setCodec(ObjectCodec oc)
Method for associating a
ObjectCodec (typically
a com.fasterxml.jackson.databind.ObjectMapper )
with this factory (and more importantly, parsers and generators
it constructs). |
JsonFactory |
setInputDecorator(InputDecorator d)
Deprecated.
Since 2.10 use
TSFBuilder.inputDecorator(InputDecorator) instead |
JsonFactory |
setOutputDecorator(OutputDecorator d)
Deprecated.
Since 2.10 use
TSFBuilder.inputDecorator(InputDecorator) instead |
JsonFactory |
setRootValueSeparator(java.lang.String sep)
Method that allows overriding String used for separating root-level
JSON values (default is single space character)
|
Version |
version()
Method called to detect version of the component that implements this interface;
returned version should never be null, but may return specific "not available"
instance (see
Version for details). |
public static final java.lang.String FORMAT_NAME_JSON
getFormatName()
public static final SerializableString DEFAULT_ROOT_VALUE_SEPARATOR
public static final char DEFAULT_QUOTE_CHAR
public JsonFactory()
public JsonFactory(ObjectCodec oc)
public JsonFactory(JsonFactoryBuilder b)
JsonFactoryBuilder
for instantiation.public TSFBuilder<?,?> rebuild()
public static TSFBuilder<?,?> builder()
JsonFactory
instances with
different configuration: creates and returns a builder for collecting configuration
settings; instance created by calling build()
after all configuration
set.
NOTE: signature unfortunately does not expose true implementation type; this will be fixed in 3.0.
public JsonFactory copy()
JsonFactory
that has
the same settings as this instance, but is otherwise
independent (i.e. nothing is actually shared, symbol tables
are separate).
Note that ObjectCodec
reference is not copied but is
set to null; caller typically needs to set it after calling
this method. Reason for this is that the codec is used for
callbacks, and assumption is that there is strict 1-to-1
mapping between codec, factory. Caller has to, then, explicitly
set codec after making the copy.public boolean requiresPropertyOrdering()
Default implementation returns false
as JSON does NOT
require stable ordering. Formats that require ordering include positional
textual formats like CSV
, and schema-based binary formats
like Avro
.
requiresPropertyOrdering
in class TokenStreamFactory
public boolean canHandleBinaryNatively()
Default implementation returns false
as JSON does not
support native access: all binary content must use Base64 encoding.
Most binary formats (like Smile and Avro) support native binary content.
canHandleBinaryNatively
in class TokenStreamFactory
public boolean canUseCharArrays()
char[]
is something that actual
parser implementations can take advantage of, over having to
use Reader
. Sub-types are expected to override
definition; default implementation (suitable for JSON) alleges
that optimization are possible; and thereby is likely to try
to access String
content by first copying it into
recyclable intermediate buffer.public boolean canParseAsync()
NonBlockingInputFeeder
.canParseAsync
in class TokenStreamFactory
public java.lang.Class<? extends FormatFeature> getFormatReadFeatureType()
TokenStreamFactory
FormatFeature
that a parser
JsonParser
produced by this factory would accept, if any;
null
returned if none.getFormatReadFeatureType
in class TokenStreamFactory
public java.lang.Class<? extends FormatFeature> getFormatWriteFeatureType()
TokenStreamFactory
FormatFeature
that a parser
JsonGenerator
produced by this factory would accept, if any;
null
returned if none.getFormatWriteFeatureType
in class TokenStreamFactory
public boolean canUseSchema(FormatSchema schema)
canUseSchema
in class TokenStreamFactory
public java.lang.String getFormatName()
Note: sub-classes should override this method; default implementation will return null for all sub-classes
getFormatName
in class TokenStreamFactory
public MatchStrength hasFormat(InputAccessor acc) throws java.io.IOException
java.io.IOException
public boolean requiresCustomCodec()
ObjectCodec
is needed for binding data parsed
using JsonParser
constructed by this factory
(which typically also implies the same for serialization
with JsonGenerator
).ObjectCodec
is enoughpublic Version version()
Versioned
Version
for details).@Deprecated public final JsonFactory configure(JsonFactory.Feature f, boolean state)
TSFBuilder.configure(JsonFactory.Feature, boolean)
insteadJsonParser.Feature
for list of features)@Deprecated public JsonFactory enable(JsonFactory.Feature f)
TSFBuilder.configure(JsonFactory.Feature, boolean)
insteadJsonFactory.Feature
for list of features)@Deprecated public JsonFactory disable(JsonFactory.Feature f)
TSFBuilder.configure(JsonFactory.Feature, boolean)
insteadJsonFactory.Feature
for list of features)public final boolean isEnabled(JsonFactory.Feature f)
public final int getParserFeatures()
getParserFeatures
in class TokenStreamFactory
public final int getGeneratorFeatures()
getGeneratorFeatures
in class TokenStreamFactory
public int getFormatParserFeatures()
getFormatParserFeatures
in class TokenStreamFactory
public int getFormatGeneratorFeatures()
getFormatGeneratorFeatures
in class TokenStreamFactory
public final JsonFactory configure(JsonParser.Feature f, boolean state)
JsonParser.Feature
for list of features)public JsonFactory enable(JsonParser.Feature f)
JsonParser.Feature
for list of features)public JsonFactory disable(JsonParser.Feature f)
JsonParser.Feature
for list of features)public final boolean isEnabled(JsonParser.Feature f)
isEnabled
in class TokenStreamFactory
public final boolean isEnabled(StreamReadFeature f)
public InputDecorator getInputDecorator()
@Deprecated public JsonFactory setInputDecorator(InputDecorator d)
TSFBuilder.inputDecorator(InputDecorator)
insteadpublic final JsonFactory configure(JsonGenerator.Feature f, boolean state)
JsonGenerator.Feature
for list of features)public JsonFactory enable(JsonGenerator.Feature f)
JsonGenerator.Feature
for list of features)public JsonFactory disable(JsonGenerator.Feature f)
JsonGenerator.Feature
for list of features)public final boolean isEnabled(JsonGenerator.Feature f)
isEnabled
in class TokenStreamFactory
public final boolean isEnabled(StreamWriteFeature f)
public CharacterEscapes getCharacterEscapes()
JsonGenerator
s
it creates.public JsonFactory setCharacterEscapes(CharacterEscapes esc)
JsonGenerator
s
it creates.public OutputDecorator getOutputDecorator()
@Deprecated public JsonFactory setOutputDecorator(OutputDecorator d)
TSFBuilder.inputDecorator(InputDecorator)
insteadpublic JsonFactory setRootValueSeparator(java.lang.String sep)
sep
- Separator to use, if any; null means that no separator is
automatically addedpublic java.lang.String getRootValueSeparator()
public JsonFactory setCodec(ObjectCodec oc)
ObjectCodec
(typically
a com.fasterxml.jackson.databind.ObjectMapper
)
with this factory (and more importantly, parsers and generators
it constructs). This is needed to use data-binding methods
of JsonParser
and JsonGenerator
instances.public ObjectCodec getCodec()
public JsonParser createParser(java.io.File f) throws java.io.IOException, JsonParseException
Encoding is auto-detected from contents according to JSON
specification recommended mechanism. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use createParser(java.io.Reader)
.
Underlying input stream (needed for reading contents) will be owned (and managed, i.e. closed as need be) by the parser, since caller has no access to it.
createParser
in class TokenStreamFactory
f
- File that contains JSON content to parsejava.io.IOException
JsonParseException
public JsonParser createParser(java.net.URL url) throws java.io.IOException, JsonParseException
Encoding is auto-detected from contents according to JSON
specification recommended mechanism. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use createParser(java.io.Reader)
.
Underlying input stream (needed for reading contents) will be owned (and managed, i.e. closed as need be) by the parser, since caller has no access to it.
createParser
in class TokenStreamFactory
url
- URL pointing to resource that contains JSON content to parsejava.io.IOException
JsonParseException
public JsonParser createParser(java.io.InputStream in) throws java.io.IOException, JsonParseException
The input stream will not be owned by
the parser, it will still be managed (i.e. closed if
end-of-stream is reacher, or parser close method called)
if (and only if) StreamReadFeature.AUTO_CLOSE_SOURCE
is enabled.
Note: no encoding argument is taken since it can always be
auto-detected as suggested by JSON RFC. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use createParser(java.io.Reader)
.
createParser
in class TokenStreamFactory
in
- InputStream to use for reading JSON content to parsejava.io.IOException
JsonParseException
public JsonParser createParser(java.io.Reader r) throws java.io.IOException, JsonParseException
The read stream will not be owned by
the parser, it will still be managed (i.e. closed if
end-of-stream is reacher, or parser close method called)
if (and only if) StreamReadFeature.AUTO_CLOSE_SOURCE
is enabled.
createParser
in class TokenStreamFactory
r
- Reader to use for reading JSON content to parsejava.io.IOException
JsonParseException
public JsonParser createParser(byte[] data) throws java.io.IOException, JsonParseException
createParser
in class TokenStreamFactory
java.io.IOException
JsonParseException
public JsonParser createParser(byte[] data, int offset, int len) throws java.io.IOException, JsonParseException
createParser
in class TokenStreamFactory
data
- Buffer that contains data to parseoffset
- Offset of the first data byte within bufferlen
- Length of contents to parse within bufferjava.io.IOException
JsonParseException
public JsonParser createParser(java.lang.String content) throws java.io.IOException, JsonParseException
createParser
in class TokenStreamFactory
java.io.IOException
JsonParseException
public JsonParser createParser(char[] content) throws java.io.IOException
createParser
in class TokenStreamFactory
java.io.IOException
public JsonParser createParser(char[] content, int offset, int len) throws java.io.IOException
createParser
in class TokenStreamFactory
java.io.IOException
public JsonParser createParser(java.io.DataInput in) throws java.io.IOException
DataInput
instance.
If this factory does not support DataInput
as source,
will throw UnsupportedOperationException
createParser
in class TokenStreamFactory
java.io.IOException
public JsonParser createNonBlockingByteArrayParser() throws java.io.IOException
ByteArrayFeeder
interface (accessed using JsonParser.getNonBlockingInputFeeder()
from constructed instance).
If this factory does not support non-blocking parsing (either at all,
or from byte array),
will throw UnsupportedOperationException
createNonBlockingByteArrayParser
in class TokenStreamFactory
java.io.IOException
public JsonGenerator createGenerator(java.io.OutputStream out, JsonEncoding enc) throws java.io.IOException
Underlying stream is NOT owned by the generator constructed,
so that generator will NOT close the output stream when
JsonGenerator.close()
is called (unless auto-closing
feature,
JsonGenerator.Feature.AUTO_CLOSE_TARGET
is enabled).
Using application needs to close it explicitly if this is the case.
Note: there are formats that use fixed encoding (like most binary data formats) and that ignore passed in encoding.
createGenerator
in class TokenStreamFactory
out
- OutputStream to use for writing JSON contentenc
- Character encoding to usejava.io.IOException
public JsonGenerator createGenerator(java.io.OutputStream out) throws java.io.IOException
Note: there are formats that use fixed encoding (like most binary data formats).
createGenerator
in class TokenStreamFactory
java.io.IOException
public JsonGenerator createGenerator(java.io.Writer w) throws java.io.IOException
Underlying stream is NOT owned by the generator constructed,
so that generator will NOT close the Reader when
JsonGenerator.close()
is called (unless auto-closing
feature,
JsonGenerator.Feature.AUTO_CLOSE_TARGET
is enabled).
Using application needs to close it explicitly.
createGenerator
in class TokenStreamFactory
w
- Writer to use for writing JSON contentjava.io.IOException
public JsonGenerator createGenerator(java.io.File f, JsonEncoding enc) throws java.io.IOException
Underlying stream is owned by the generator constructed,
i.e. generator will handle closing of file when
JsonGenerator.close()
is called.
createGenerator
in class TokenStreamFactory
f
- File to write contents toenc
- Character encoding to usejava.io.IOException
public JsonGenerator createGenerator(java.io.DataOutput out, JsonEncoding enc) throws java.io.IOException
DataOutput
instance.createGenerator
in class TokenStreamFactory
java.io.IOException
public JsonGenerator createGenerator(java.io.DataOutput out) throws java.io.IOException
Note: there are formats that use fixed encoding (like most binary data formats).
createGenerator
in class TokenStreamFactory
java.io.IOException
@Deprecated public JsonParser createJsonParser(java.io.File f) throws java.io.IOException, JsonParseException
createParser(File)
instead.
Encoding is auto-detected from contents according to JSON
specification recommended mechanism. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use createParser(java.io.Reader)
.
Underlying input stream (needed for reading contents) will be owned (and managed, i.e. closed as need be) by the parser, since caller has no access to it.
f
- File that contains JSON content to parsejava.io.IOException
JsonParseException
@Deprecated public JsonParser createJsonParser(java.net.URL url) throws java.io.IOException, JsonParseException
createParser(URL)
instead.
Encoding is auto-detected from contents according to JSON
specification recommended mechanism. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use createParser(java.io.Reader)
.
Underlying input stream (needed for reading contents) will be owned (and managed, i.e. closed as need be) by the parser, since caller has no access to it.
url
- URL pointing to resource that contains JSON content to parsejava.io.IOException
JsonParseException
@Deprecated public JsonParser createJsonParser(java.io.InputStream in) throws java.io.IOException, JsonParseException
createParser(InputStream)
instead.
The input stream will not be owned by
the parser, it will still be managed (i.e. closed if
end-of-stream is reacher, or parser close method called)
if (and only if) JsonParser.Feature.AUTO_CLOSE_SOURCE
is enabled.
Note: no encoding argument is taken since it can always be
auto-detected as suggested by JSON RFC. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use createParser(java.io.Reader)
.
in
- InputStream to use for reading JSON content to parsejava.io.IOException
JsonParseException
@Deprecated public JsonParser createJsonParser(java.io.Reader r) throws java.io.IOException, JsonParseException
createParser(Reader)
instead.
The read stream will not be owned by
the parser, it will still be managed (i.e. closed if
end-of-stream is reacher, or parser close method called)
if (and only if) JsonParser.Feature.AUTO_CLOSE_SOURCE
is enabled.
r
- Reader to use for reading JSON content to parsejava.io.IOException
JsonParseException
@Deprecated public JsonParser createJsonParser(byte[] data) throws java.io.IOException, JsonParseException
createParser(byte[])
instead.java.io.IOException
JsonParseException
@Deprecated public JsonParser createJsonParser(byte[] data, int offset, int len) throws java.io.IOException, JsonParseException
createParser(byte[],int,int)
instead.data
- Buffer that contains data to parseoffset
- Offset of the first data byte within bufferlen
- Length of contents to parse within bufferjava.io.IOException
JsonParseException
@Deprecated public JsonParser createJsonParser(java.lang.String content) throws java.io.IOException, JsonParseException
createParser(String)
instead.java.io.IOException
JsonParseException
@Deprecated public JsonGenerator createJsonGenerator(java.io.OutputStream out, JsonEncoding enc) throws java.io.IOException
createGenerator(OutputStream, JsonEncoding)
instead.
Underlying stream is NOT owned by the generator constructed,
so that generator will NOT close the output stream when
JsonGenerator.close()
is called (unless auto-closing
feature,
JsonGenerator.Feature.AUTO_CLOSE_TARGET
is enabled).
Using application needs to close it explicitly if this is the case.
Note: there are formats that use fixed encoding (like most binary data formats) and that ignore passed in encoding.
out
- OutputStream to use for writing JSON contentenc
- Character encoding to usejava.io.IOException
@Deprecated public JsonGenerator createJsonGenerator(java.io.Writer out) throws java.io.IOException
createGenerator(Writer)
instead.
Underlying stream is NOT owned by the generator constructed,
so that generator will NOT close the Reader when
JsonGenerator.close()
is called (unless auto-closing
feature,
JsonGenerator.Feature.AUTO_CLOSE_TARGET
is enabled).
Using application needs to close it explicitly.
out
- Writer to use for writing JSON contentjava.io.IOException
@Deprecated public JsonGenerator createJsonGenerator(java.io.OutputStream out) throws java.io.IOException
createGenerator(OutputStream)
instead.Note: there are formats that use fixed encoding (like most binary data formats).
java.io.IOException
public BufferRecycler _getBufferRecycler()
Note: only public to give access for ObjectMapper
Copyright © 2010 - 2020 Adobe. All Rights Reserved