public class CBORFactory
extends com.fasterxml.jackson.core.JsonFactory
CBORParser and CBORGenerator
instances; both of which handle
CBOR
encoded data.
Extends JsonFactory mostly so that users can actually use it in place
of regular non-CBOR factory instances.
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.
| Modifier and Type | Field and Description |
|---|---|
protected int |
_formatGeneratorFeatures |
protected int |
_formatParserFeatures |
static String |
FORMAT_NAME
Name used to identify CBOR format.
|
_byteSymbolCanonicalizer, _characterEscapes, _factoryFeatures, _generatorFeatures, _inputDecorator, _maximumNonEscapedChar, _objectCodec, _outputDecorator, _parserFeatures, _quoteChar, _rootCharSymbols, _rootValueSeparator, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, DEFAULT_QUOTE_CHAR, DEFAULT_ROOT_VALUE_SEPARATOR, FORMAT_NAME_JSON| Modifier | Constructor and Description |
|---|---|
|
CBORFactory()
Default constructor used to create factory instances.
|
protected |
CBORFactory(CBORFactoryBuilder b)
Constructors used by
CBORFactoryBuilder for instantiation. |
|
CBORFactory(CBORFactory src,
com.fasterxml.jackson.core.ObjectCodec oc)
Note: REQUIRES at least 2.2.1 -- unfortunate intra-patch dep but seems
preferable to just leaving bug be as is
|
|
CBORFactory(com.fasterxml.jackson.core.ObjectCodec oc) |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.core.io.IOContext |
_createContext(com.fasterxml.jackson.core.io.ContentReference contentRef,
boolean resourceManaged) |
protected CBORGenerator |
_createGenerator(Writer out,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected CBORParser |
_createParser(byte[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired
parser.
|
protected com.fasterxml.jackson.core.JsonParser |
_createParser(char[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt,
boolean recyclable) |
protected CBORParser |
_createParser(InputStream in,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired
parser.
|
protected com.fasterxml.jackson.core.JsonParser |
_createParser(Reader r,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired
parser.
|
protected CBORGenerator |
_createUTF8Generator(OutputStream out,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected Writer |
_createWriter(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected <T> T |
_nonByteSource() |
protected <T> T |
_nonByteTarget() |
static CBORFactoryBuilder |
builder()
Main factory method to use for constructing
CBORFactory instances with
different configuration. |
boolean |
canHandleBinaryNatively() |
boolean |
canUseCharArrays() |
CBORFactory |
configure(CBORGenerator.Feature f,
boolean state)
Method for enabling or disabling specified generator feature
(check
CBORGenerator.Feature for list of features) |
CBORFactory |
configure(CBORParser.Feature f,
boolean state)
Method for enabling or disabling specified parser feature
(check
CBORParser.Feature for list of features) |
CBORFactory |
copy() |
CBORGenerator |
createGenerator(OutputStream out)
Method for constructing
JsonGenerator for generating
CBOR-encoded output. |
CBORGenerator |
createGenerator(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc)
Method for constructing
JsonGenerator for generating
CBOR-encoded output. |
CBORParser |
createParser(byte[] data) |
CBORParser |
createParser(byte[] data,
int offset,
int len) |
CBORParser |
createParser(File f) |
CBORParser |
createParser(InputStream in) |
CBORParser |
createParser(URL url) |
CBORFactory |
disable(CBORGenerator.Feature f)
Method for disabling specified generator feature
(check
CBORGenerator.Feature for list of features) |
CBORFactory |
disable(CBORParser.Feature f)
Method for disabling specified parser features
(check
CBORParser.Feature for list of features) |
CBORFactory |
enable(CBORGenerator.Feature f)
Method for enabling specified generator features
(check
CBORGenerator.Feature for list of features) |
CBORFactory |
enable(CBORParser.Feature f)
Method for enabling specified parser feature
(check
CBORParser.Feature for list of features) |
int |
getFormatGeneratorFeatures() |
String |
getFormatName() |
int |
getFormatParserFeatures() |
Class<CBORParser.Feature> |
getFormatReadFeatureType() |
Class<CBORGenerator.Feature> |
getFormatWriteFeatureType() |
com.fasterxml.jackson.core.format.MatchStrength |
hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) |
boolean |
isEnabled(CBORGenerator.Feature f)
Check whether specified generator feature is enabled.
|
boolean |
isEnabled(CBORParser.Feature f)
Checked whether specified parser feature is enabled.
|
protected Object |
readResolve()
Method that we need to override to actually make restoration go
through constructors etc.
|
CBORFactoryBuilder |
rebuild() |
com.fasterxml.jackson.core.Version |
version() |
_checkInvalidCopy, _createContentReference, _createContentReference, _createContext, _createNonBlockingContext, _createParser, _decorate, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, canParseAsync, canUseSchema, configure, configure, configure, createGenerator, createGenerator, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteArrayParser, createParser, createParser, createParser, createParser, createParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getCodec, getGeneratorFeatures, getInputDecorator, getOutputDecorator, getParserFeatures, getRootValueSeparator, hasJSONFormat, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, requiresCustomCodec, requiresPropertyOrdering, setCharacterEscapes, setCodec, setInputDecorator, setOutputDecorator, setRootValueSeparatorpublic static final String FORMAT_NAME
getFormatName()protected int _formatParserFeatures
protected int _formatGeneratorFeatures
public CBORFactory()
public CBORFactory(com.fasterxml.jackson.core.ObjectCodec oc)
public CBORFactory(CBORFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
protected CBORFactory(CBORFactoryBuilder b)
CBORFactoryBuilder for instantiation.public CBORFactoryBuilder rebuild()
rebuild in class com.fasterxml.jackson.core.JsonFactorypublic static CBORFactoryBuilder builder()
CBORFactory instances with
different configuration.public CBORFactory copy()
copy in class com.fasterxml.jackson.core.JsonFactoryprotected Object readResolve()
readResolve in class com.fasterxml.jackson.core.JsonFactorypublic com.fasterxml.jackson.core.Version version()
version in interface com.fasterxml.jackson.core.Versionedversion in class com.fasterxml.jackson.core.JsonFactorypublic String getFormatName()
getFormatName in class com.fasterxml.jackson.core.JsonFactorypublic boolean canUseCharArrays()
canUseCharArrays in class com.fasterxml.jackson.core.JsonFactorypublic com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
throws IOException
hasFormat in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic boolean canHandleBinaryNatively()
canHandleBinaryNatively in class com.fasterxml.jackson.core.JsonFactorypublic Class<CBORParser.Feature> getFormatReadFeatureType()
getFormatReadFeatureType in class com.fasterxml.jackson.core.JsonFactorypublic Class<CBORGenerator.Feature> getFormatWriteFeatureType()
getFormatWriteFeatureType in class com.fasterxml.jackson.core.JsonFactorypublic final CBORFactory configure(CBORParser.Feature f, boolean state)
CBORParser.Feature for list of features)public CBORFactory enable(CBORParser.Feature f)
CBORParser.Feature for list of features)public CBORFactory disable(CBORParser.Feature f)
CBORParser.Feature for list of features)public final boolean isEnabled(CBORParser.Feature f)
public int getFormatParserFeatures()
getFormatParserFeatures in class com.fasterxml.jackson.core.JsonFactorypublic final CBORFactory configure(CBORGenerator.Feature f, boolean state)
CBORGenerator.Feature for list of features)public CBORFactory enable(CBORGenerator.Feature f)
CBORGenerator.Feature for list of features)public CBORFactory disable(CBORGenerator.Feature f)
CBORGenerator.Feature for list of features)public final boolean isEnabled(CBORGenerator.Feature f)
public int getFormatGeneratorFeatures()
getFormatGeneratorFeatures in class com.fasterxml.jackson.core.JsonFactorypublic CBORParser createParser(File f) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic CBORParser createParser(URL url) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic CBORParser createParser(InputStream in) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic CBORParser createParser(byte[] data) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic CBORParser createParser(byte[] data, int offset, int len) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic CBORGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
JsonGenerator for generating
CBOR-encoded output.
Since CBOR format always uses UTF-8 internally, enc
argument is ignored.
createGenerator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic CBORGenerator createGenerator(OutputStream out) throws IOException
JsonGenerator for generating
CBOR-encoded output.
Since CBOR format always uses UTF-8 internally, no encoding need to be passed to this method.
createGenerator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected com.fasterxml.jackson.core.io.IOContext _createContext(com.fasterxml.jackson.core.io.ContentReference contentRef,
boolean resourceManaged)
_createContext in class com.fasterxml.jackson.core.JsonFactoryprotected CBORParser _createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected com.fasterxml.jackson.core.JsonParser _createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected com.fasterxml.jackson.core.JsonParser _createParser(char[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt,
boolean recyclable)
throws IOException
_createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected CBORParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected CBORGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createGenerator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected CBORGenerator _createUTF8Generator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createUTF8Generator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected Writer _createWriter(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createWriter in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected <T> T _nonByteSource()
protected <T> T _nonByteTarget()
Copyright © 2021 FasterXML. All rights reserved.