JsonParser)
and token 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.
JsonFactory)
| Modifier and Type | Class and Description |
|---|---|
| public static enum | TokenStreamFactory.
Enumeration that defines all on/off features that can only be
changed for |
| Modifier and Type | Field and Description |
|---|---|
| protected final ErrorReportConfiguration | _errorReportConfiguration
Active ErrorReportConfiguration to use. |
| protected final int | _factoryFeatures
Currently enabled |
| protected final int | _formatReadFeatures
Set of format-specific read features enabled, as bitmask. |
| protected final int | _formatWriteFeatures
Set of format-specific write features enabled, as bitmask. |
| protected final RecyclerPool | |
| protected final StreamReadConstraints | _streamReadConstraints
Active StreamReadConstraints to use. |
| protected final int | _streamReadFeatures
Currently enabled |
| protected final StreamWriteConstraints | _streamWriteConstraints
Active StreamWriteConstraints to use. |
| protected final int | _streamWriteFeatures
Currently enabled |
| protected static final int | DEFAULT_FACTORY_FEATURE_FLAGS
Bitfield (set of flags) of all factory features that are enabled by default. |
| protected static final int | DEFAULT_STREAM_READ_FEATURE_FLAGS
Bitfield (set of flags) of all parser features that are enabled by default. |
| protected static final int | DEFAULT_STREAM_WRITE_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled by default. |
| public static final ObjectWriteContext | EMPTY_WRITE_CONTEXT
Shareable stateles "empty" |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | TokenStreamFactory(StreamReadConstraints
StreamReadConstraints to use with parsers factory creates src, StreamWriteConstraints StreamWriteConstraints to use with generators factory creates swc, ErrorReportConfiguration ErrorReportConfiguration to use with parsers factory creates erc, int Bitmask of format-specific read features enabled formatReadFeatures, int Bitmask of format-specific write features enabled formatWriteFeatures)Default constructor used to create factory instances. |
| protected | TokenStreamFactory(TSFBuilder<?, ?>
Builder with configuration to use baseBuilder)Constructors used by |
| protected | TokenStreamFactory(TokenStreamFactory
Source factory with configuration to copy src)Constructor used if a snapshot is created, or possibly for sub-classing or wrapping (delegating) |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| protected abstract ContentReference | Returns: InputSourceReference instance to useUnderlying input source (parser) or target (generator) contentRef)Overridable factory method for constructing |
| protected abstract ContentReference | Returns: InputSourceReference instance to useUnderlying input source (parser) or target (generator) contentRef, int Offset of content in buffer ( offset, int rawSource)Length of content in buffer ( length)rawSource)Overridable factory method for constructing |
| protected IOContext | Returns: Context constructedSource reference to use (relevant to contentRef, boolean TokenStreamLocation construction)Whether input/output buffers used are managed by this factory resourceManaged)Overridable factory method that actually instantiates desired context object. |
| protected IOContext | Returns: Context constructedSource reference to use (relevant to contentRef, boolean TokenStreamLocation construction)Whether input/output buffers used are managed by this factory resourceManaged, JsonEncoding Character encoding defined to be used/expected enc)Overridable factory method that actually instantiates desired context object. |
| protected OutputStream | |
| protected InputStream | Returns: InputStream constructedFile to open stream for f)Helper methods used for constructing an |
| protected OutputStream | Returns: OutputStream constructedFile to open stream for f)Helper methods used for constructing an |
| public BufferRecycler | Returns: BufferRecycler instance to useMethod used by factory to create buffer recycler instances for parsers and generators. |
| public RecyclerPool | Returns: RecyclerPool configured for (and used by) this factory.Accessor for getting access to |
| protected InputStream | Returns: InputStream constructed for givenURLSource to read content to parse from url)
Deprecated
Since 3.0
Helper method used for constructing an optimal stream for parsers to use, when input is to be read from an URL. |
| protected InputStream | |
| protected OutputStream | |
| protected <T> T | |
| protected <T> T | |
| protected <T> T | |
| protected JacksonException | |
| public abstract boolean | Returns: Whether format supported by this factory supports native binary contentIntrospection method that higher-level functionality may call to see whether underlying data format can read and write binary data natively; that is, embedded it as-is without using encodings such as Base64. |
| public abstract boolean | Returns: Whether this factory supports non-blocking ("async") parsing or not (and consequently whethercreateNonBlockingXxx() method(s) work)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
|
| public abstract boolean | Returns: Whether parsers and generators constructed by this factory can use specified format schema instanceSchema instance to check 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. |
| public PropertyNameMatcher | Returns: Case-insensitivePropertyNameMatcher instance to useNames to match, including both primary names and possible aliases matches, boolean Whether name Strings are already alreadyInterned, Locale String.intern()ed or notLocale to use for case-handling locale)Factory method for constructing case-insensitive |
| public PropertyNameMatcher | Returns: Case-sensitivePropertyNameMatcher instance to useNames to match, including both primary names and possible aliases matches, boolean Whether name Strings are already alreadyInterned)String.intern()ed or notFactory method for constructing case-sensitive |
| public abstract TokenStreamFactory | Returns: Newly constructed stream factory instance of same type as this one, with identical configuration settingsMethod similar to |
| public JsonGenerator | Returns: Generator constructedObject-binding context where applicable; used for providing contextual
configuration writeCtxt, OutputStream OutputStream to use for writing content out)Method for constructing generator that writes contents
using specified |
| public abstract JsonGenerator | Returns: Generator constructedObject-binding context where applicable; used for providing contextual
configuration writeCtxt, OutputStream OutputStream to use for writing content out, JsonEncoding Character set encoding to use (usually enc)JsonEncoding#UTF8)Method for constructing generator that writes contents
using specified |
| public abstract JsonGenerator | Returns: Generator constructedObject-binding context where applicable; used for providing contextual
configuration writeCtxt, Writer Writer to use for writing content w)Method for constructing generator that writes contents
using specified |
| public abstract JsonGenerator | Returns: Generator constructedObject-binding context where applicable; used for providing contextual
configuration writeCtxt, File File to write contents to f, JsonEncoding Character set encoding to use (usually enc)JsonEncoding#UTF8)Method for constructing generator that writes contents to specified file, overwriting contents it might have (or creating it if such file does not yet exist). |
| public abstract JsonGenerator | Returns: Generator constructedObject-binding context where applicable; used for providing contextual
configuration writeCtxt, Path Path to write contents to p, JsonEncoding Character set encoding to use (usually enc)JsonEncoding#UTF8)Method for constructing generator that writes contents to specified path, overwriting contents it might have (or creating it if such path does not yet exist). |
| public JsonGenerator | Returns: Generator constructedObject-binding context where applicable; used for providing contextual
configuration writeCtxt, DataOutput DataOutput used as target of generationMethod for constructing generator that writes content into specified |
| public JsonGenerator | Returns: Generator constructedOutputStream to use for writing content out, JsonEncoding Character encoding to use enc)
Deprecated
Method for constructing JSON generator for writing content using specified output stream. |
| public JsonGenerator | Returns: Generator constructedOutputStream to use for writing content out)
Deprecated
Convenience method for constructing generator that uses default encoding of the format (UTF-8 for JSON and most other data formats), |
| public JsonGenerator | Returns: Generator constructedWriter to use for writing content w)
Deprecated
Method for constructing JSON generator for writing content using specified Writer. |
| public < Nominal type of parser constructed and returned P extends JsonParser & ByteArrayFeeder> P | Returns: Non-blocking parser constructedObject read context to use readCtxt)Optional method for constructing parser for non-blocking parsing
via |
| public < Nominal type of parser constructed and returned P extends JsonParser & ByteArrayFeeder> P | Returns: Non-blocking parser constructedObject read context to use readCtxt)Optional method for constructing parser for non-blocking parsing
via |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, File File that contains content to parse f)Method for constructing parser instance to decode contents of specified file. |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, Path Path that contains content to parse p)Method for constructing parser instance to decode contents of specified path. |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, InputStream InputStream to use for reading content to parse in)Method for constructing JSON parser instance to parse the contents accessed via specified input stream. |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, Reader Reader to use for reading content to parse r)Method for constructing parser for parsing the contents accessed via specified Reader. |
| public JsonParser | Returns: Parser constructedObject read context to use readCtxt, byte[] Content to read data)Method for constructing parser for parsing the contents of given byte array. |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, byte[] Buffer that contains data to parse content, int Offset of the first data byte within buffer offset, int Length of contents to parse within buffer len)Method for constructing parser for parsing the contents of given byte array. |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, String Content to read content)Method for constructing parser for parsing contents of given String. |
| public JsonParser | Returns: Parser constructedObject read context to use readCtxt, char[] Content to read content)Method for constructing parser for parsing contents of given char array. |
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, char[] Buffer that contains data to parse content, int Offset of the first data byte within buffer offset, int Length of contents to parse within buffer len)Method for constructing parser for parsing contents of given char array. |
| public JsonParser | Returns: Parser constructedFile that contains content to parse f)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, java.
|
| public JsonParser | Returns: Parser constructedInputStream to use for reading content to parse in)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, java.
|
| public JsonParser | Returns: Parser constructedReader to use for reading content to parse r)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, java.
|
| public JsonParser | Returns: Parser constructedBuffer that contains content to parse content)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, byte[])
|
| public JsonParser | Returns: Parser constructedBuffer that contains content to parse content, int Offset of the first data byte within buffer offset, int Length of contents to parse within buffer len)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, byte[], int, int)
|
| public JsonParser | Returns: Parser constructedContent to parse content)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, String)
|
| public JsonParser | Returns: Parser constructedBuffer that contains data to parse content)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, char[])
|
| public JsonParser | Returns: Parser constructedBuffer that contains data to parse content, int Offset of the first data byte within buffer offset, int Length of contents to parse within buffer len)
Deprecated
Since 3.0 use
createParser(ObjectReadContext, char[], int, int)
|
| public abstract JsonParser | Returns: Parser constructedObject read context to use readCtxt, DataInput InputStream to use for reading content to parse in)Optional method for constructing parser for reading contents from specified |
| public ErrorReportConfiguration | |
| public final int | |
| public abstract String | Returns: Name of the format handled by parsers, generators this factory createsMethod that returns short textual id identifying format this factory supports. |
| public int | |
| public Class | Returns: Type of format-specific stream read features, if any;null if noneMethod for accessing kind of |
| public int | |
| public Class | Returns: Type of format-specific stream read features, if any;null if noneMethod for accessing kind of |
| public final int | |
| public final int | |
| public final boolean | Returns: True if feature is enabled; false otherwiseFeature to check fChecked whether specified parser feature is enabled. |
| public final boolean | Returns: True if feature is enabled; false otherwiseFeature to check f)Checked whether specified parser feature is enabled. |
| public final boolean | Returns: True if feature is enabled; false otherwiseFeature to check f)Checked whether specified parser feature is enabled. |
| public abstract TSFBuilder | Returns: Builder instance initialized with configuration this stream factory hasMethod that can be used to create differently configured stream factories: it will create and return a Builder instance with exact settings of this stream factory. |
| public boolean | Returns: Whether format supported by this factory requires Object properties to be ordered.Introspection method that higher-level functionality may call to see whether underlying data format requires a stable ordering of object properties or not. |
| public abstract TokenStreamFactory | Returns: This factory instance to allow call chainingRedeclares tools. Method for constructing a new |
| public StreamReadConstraints | |
| public StreamWriteConstraints | |
| public abstract Version | version()
Redeclares tools. 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 |