Class CBORFactory
java.lang.Object
tools.jackson.core.TokenStreamFactory
tools.jackson.core.base.DecorableTSFactory
tools.jackson.core.base.BinaryTSFactory
tools.jackson.dataformat.cbor.CBORFactory
- All Implemented Interfaces:
Serializable, tools.jackson.core.util.Snapshottable<tools.jackson.core.TokenStreamFactory>, tools.jackson.core.Versioned
Factory used for constructing
CBORParser and CBORGenerator
instances; both of which handle
CBOR
encoded data.
Note on using non-byte-based sources/targets (char based, like
Reader and Writer): these can not be
used for CBOR documents; attempt will throw exception.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.base.DecorableTSFactory
tools.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder<F,T> Nested classes/interfaces inherited from class tools.jackson.core.TokenStreamFactory
tools.jackson.core.TokenStreamFactory.Feature -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final tools.jackson.core.sym.ByteQuadsCanonicalizerAlternative to the basic symbol table, some stream-based parsers use different name canonicalization method.(package private) static final intBitfield (set of flags) of all generator features that are enabled by default.(package private) static final intBitfield (set of flags) of all generator features that are enabled by default.static final StringName used to identify CBOR format.private static final longFields inherited from class tools.jackson.core.base.DecorableTSFactory
_generatorDecorators, _inputDecorator, _outputDecoratorFields inherited from class tools.jackson.core.TokenStreamFactory
_errorReportConfiguration, _factoryFeatures, _formatReadFeatures, _formatWriteFeatures, _recyclerPool, _streamReadConstraints, _streamReadFeatures, _streamWriteConstraints, _streamWriteFeatures, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_STREAM_READ_FEATURE_FLAGS, DEFAULT_STREAM_WRITE_FEATURE_FLAGS, EMPTY_WRITE_CONTEXT -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault constructor used to create factory instances.CBORFactory(CBORFactory src) protectedConstructors used byCBORFactoryBuilderfor instantiation. -
Method Summary
Modifier and TypeMethodDescriptionprotected tools.jackson.core.io.IOContext_createContext(tools.jackson.core.io.ContentReference contentRef, boolean resourceManaged) protected tools.jackson.core.JsonGenerator_createGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, OutputStream out) protected CBORParser_createParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, byte[] data, int offset, int len) Overridable factory method that actually instantiates desired parser.protected tools.jackson.core.JsonParser_createParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ctxt, DataInput input) protected CBORParser_createParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, InputStream in) Overridable factory method that actually instantiates desired parser.static CBORFactoryBuilderbuilder()Main factory method to use for constructingCBORFactoryinstances with different configuration.booleanbooleancanUseSchema(tools.jackson.core.FormatSchema schema) tools.jackson.core.sym.PropertyNameMatcherconstructCINameMatcher(List<tools.jackson.core.util.Named> matches, boolean alreadyInterned, Locale locale) tools.jackson.core.sym.PropertyNameMatcherconstructNameMatcher(List<tools.jackson.core.util.Named> matches, boolean alreadyInterned) copy()booleanCheck whether specified CBOR-specific stream read feature is enabled.booleanCheck whether specified CBOR-specific stream write feature is enabled.protected ObjectMethod that we need to override to actually make restoration go through constructors etc.rebuild()tools.jackson.core.TokenStreamFactorysnapshot()Instances are immutable so just return `this`tools.jackson.core.Versionversion()Methods inherited from class tools.jackson.core.base.BinaryTSFactory
_createContentReference, _createContentReference, _nonByteSource, _nonByteTarget, canHandleBinaryNatively, createGenerator, createGenerator, createGenerator, createGenerator, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParserMethods inherited from class tools.jackson.core.base.DecorableTSFactory
_copy, _decorate, _decorate, _decorate, _decorate, _decorate, _decorate, getGeneratorDecorators, getInputDecorator, getOutputDecoratorMethods inherited from class tools.jackson.core.TokenStreamFactory
_checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _createContext, _createDataOutputWrapper, _fileInputStream, _fileOutputStream, _getBufferRecycler, _getRecyclerPool, _optimizedStreamFromURL, _pathInputStream, _pathOutputStream, _reportRangeError, _unsupported, _unsupported, _wrapIOFailure, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createNonBlockingByteArrayParser, createNonBlockingByteBufferParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, errorReportConfiguration, getFactoryFeatures, getFormatReadFeatures, getFormatWriteFeatures, getStreamReadFeatures, getStreamWriteFeatures, isEnabled, isEnabled, isEnabled, requiresPropertyOrdering, streamReadConstraints, streamWriteConstraints
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FORMAT_NAME
Name used to identify CBOR format. (and returned bygetFormatName()- See Also:
-
DEFAULT_CBOR_GENERATOR_FEATURE_FLAGS
static final int DEFAULT_CBOR_GENERATOR_FEATURE_FLAGSBitfield (set of flags) of all generator features that are enabled by default. -
DEFAULT_CBOR_PARSER_FEATURE_FLAGS
static final int DEFAULT_CBOR_PARSER_FEATURE_FLAGSBitfield (set of flags) of all generator features that are enabled by default. -
_byteSymbolCanonicalizer
protected final transient tools.jackson.core.sym.ByteQuadsCanonicalizer _byteSymbolCanonicalizerAlternative to the basic symbol table, some stream-based parsers use different name canonicalization method.
-
-
Constructor Details
-
CBORFactory
public CBORFactory()Default constructor used to create factory instances. Creation of a factory instance is a light-weight operation, but it is still a good idea to reuse limited number of factory instances (and quite often just a single instance): factories are used as context for storing some reused processing objects (such as symbol tables parsers use) and this reuse only works within context of a single factory instance. -
CBORFactory
-
CBORFactory
Constructors used byCBORFactoryBuilderfor instantiation.- Since:
- 3.0
-
-
Method Details
-
rebuild
- Specified by:
rebuildin classtools.jackson.core.TokenStreamFactory
-
builder
Main factory method to use for constructingCBORFactoryinstances with different configuration. -
copy
- Specified by:
copyin classtools.jackson.core.TokenStreamFactory
-
snapshot
public tools.jackson.core.TokenStreamFactory snapshot()Instances are immutable so just return `this`- Specified by:
snapshotin interfacetools.jackson.core.util.Snapshottable<tools.jackson.core.TokenStreamFactory>- Specified by:
snapshotin classtools.jackson.core.TokenStreamFactory
-
readResolve
Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well. -
version
public tools.jackson.core.Version version()- Specified by:
versionin interfacetools.jackson.core.Versioned- Specified by:
versionin classtools.jackson.core.TokenStreamFactory
-
canParseAsync
public boolean canParseAsync()- Specified by:
canParseAsyncin classtools.jackson.core.TokenStreamFactory
-
getFormatName
- Specified by:
getFormatNamein classtools.jackson.core.TokenStreamFactory
-
canUseSchema
public boolean canUseSchema(tools.jackson.core.FormatSchema schema) - Specified by:
canUseSchemain classtools.jackson.core.TokenStreamFactory
-
getFormatReadFeatureType
- Overrides:
getFormatReadFeatureTypein classtools.jackson.core.TokenStreamFactory
-
getFormatWriteFeatureType
- Overrides:
getFormatWriteFeatureTypein classtools.jackson.core.TokenStreamFactory
-
isEnabled
Check whether specified CBOR-specific stream read feature is enabled. -
isEnabled
Check whether specified CBOR-specific stream write feature is enabled. -
_createContext
protected tools.jackson.core.io.IOContext _createContext(tools.jackson.core.io.ContentReference contentRef, boolean resourceManaged) - Overrides:
_createContextin classtools.jackson.core.TokenStreamFactory
-
_createParser
protected CBORParser _createParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, InputStream in) Overridable factory method that actually instantiates desired parser.- Specified by:
_createParserin classtools.jackson.core.base.BinaryTSFactory
-
_createParser
protected CBORParser _createParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, byte[] data, int offset, int len) Overridable factory method that actually instantiates desired parser.- Specified by:
_createParserin classtools.jackson.core.base.BinaryTSFactory
-
_createParser
protected tools.jackson.core.JsonParser _createParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ctxt, DataInput input) - Specified by:
_createParserin classtools.jackson.core.base.BinaryTSFactory
-
_createGenerator
protected tools.jackson.core.JsonGenerator _createGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, OutputStream out) - Specified by:
_createGeneratorin classtools.jackson.core.base.BinaryTSFactory
-
constructNameMatcher
public tools.jackson.core.sym.PropertyNameMatcher constructNameMatcher(List<tools.jackson.core.util.Named> matches, boolean alreadyInterned) - Overrides:
constructNameMatcherin classtools.jackson.core.TokenStreamFactory
-
constructCINameMatcher
-