public class SmileFactory
extends com.fasterxml.jackson.core.JsonFactory
SmileParser and SmileGenerator
instances; both of which handle
Smile encoded data.
Extends JsonFactory mostly so that users can actually use it in place
of regular non-Smile factory instances.
Note on using non-byte-based sources/targets (char based, like
Reader and Writer): these can not be
used for Smile-format documents, and thus will either downgrade to
textual JSON (when parsing), or throw exception (when trying to create
generator).
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_cfgDelegateToTextual
Whether non-supported methods (ones trying to output using
char-based targets like
Writer, for example)
should be delegated to regular Jackson JSON processing
(if set to true); or throw UnsupportedOperationException
(if set to false) |
protected int |
_smileGeneratorFeatures |
protected int |
_smileParserFeatures |
static String |
FORMAT_NAME_SMILE
Name used to identify Smile 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 |
|---|---|
|
SmileFactory()
Default constructor used to create factory instances.
|
|
SmileFactory(com.fasterxml.jackson.core.ObjectCodec oc) |
protected |
SmileFactory(SmileFactoryBuilder b)
Constructors used by
SmileFactoryBuilder for instantiation. |
|
SmileFactory(SmileFactory src,
com.fasterxml.jackson.core.ObjectCodec oc)
Note: REQUIRES 2.2.1 -- unfortunate intra-patch dep but seems
preferable to just leaving bug be as is
|
| Modifier and Type | Method and Description |
|---|---|
protected SmileGenerator |
_createGenerator(OutputStream out,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected com.fasterxml.jackson.core.JsonGenerator |
_createGenerator(Writer out,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected SmileParser |
_createParser(byte[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected com.fasterxml.jackson.core.JsonParser |
_createParser(char[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt,
boolean recyclable) |
protected SmileParser |
_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) |
protected com.fasterxml.jackson.core.JsonGenerator |
_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 SmileFactoryBuilder |
builder()
Main factory method to use for constructing
SmileFactory instances with
different configuration. |
boolean |
canHandleBinaryNatively() |
boolean |
canParseAsync() |
boolean |
canUseCharArrays() |
SmileFactory |
configure(SmileGenerator.Feature f,
boolean state)
Method for enabling or disabling specified generator feature
(check
SmileGenerator.Feature for list of features) |
SmileFactory |
configure(SmileParser.Feature f,
boolean state)
Method for enabling or disabling specified parser feature
(check
SmileParser.Feature for list of features) |
SmileFactory |
copy() |
SmileGenerator |
createGenerator(OutputStream out)
Method for constructing
JsonGenerator for generating
Smile-encoded output. |
SmileGenerator |
createGenerator(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc)
Method for constructing
JsonGenerator for generating
Smile-encoded output. |
NonBlockingByteArrayParser |
createNonBlockingByteArrayParser() |
SmileParser |
createParser(byte[] data) |
SmileParser |
createParser(byte[] data,
int offset,
int len) |
SmileParser |
createParser(File f) |
SmileParser |
createParser(InputStream in) |
SmileParser |
createParser(URL url) |
void |
delegateToTextual(boolean state) |
SmileFactory |
disable(SmileGenerator.Feature f)
Method for disabling specified generator feature
(check
SmileGenerator.Feature for list of features) |
SmileFactory |
disable(SmileParser.Feature f)
Method for disabling specified parser features
(check
SmileParser.Feature for list of features) |
SmileFactory |
enable(SmileGenerator.Feature f)
Method for enabling specified generator features
(check
SmileGenerator.Feature for list of features) |
SmileFactory |
enable(SmileParser.Feature f)
Method for enabling specified parser feature
(check
SmileParser.Feature for list of features) |
int |
getFormatGeneratorFeatures() |
String |
getFormatName() |
int |
getFormatParserFeatures() |
Class<SmileParser.Feature> |
getFormatReadFeatureType() |
Class<SmileGenerator.Feature> |
getFormatWriteFeatureType() |
com.fasterxml.jackson.core.format.MatchStrength |
hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
Sub-classes need to override this method (as of 1.8)
|
boolean |
isEnabled(SmileGenerator.Feature f)
Check whether specified generator feature is enabled.
|
boolean |
isEnabled(SmileParser.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.
|
SmileFactoryBuilder |
rebuild() |
com.fasterxml.jackson.core.Version |
version() |
_checkInvalidCopy, _createContentReference, _createContentReference, _createContext, _createContext, _createNonBlockingContext, _createParser, _decorate, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, canUseSchema, configure, configure, configure, createGenerator, createGenerator, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteBufferParser, 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_SMILE
getFormatName()protected boolean _cfgDelegateToTextual
Writer, for example)
should be delegated to regular Jackson JSON processing
(if set to true); or throw UnsupportedOperationException
(if set to false)protected int _smileParserFeatures
protected int _smileGeneratorFeatures
public SmileFactory()
public SmileFactory(com.fasterxml.jackson.core.ObjectCodec oc)
public SmileFactory(SmileFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
protected SmileFactory(SmileFactoryBuilder b)
SmileFactoryBuilder for instantiation.public SmileFactoryBuilder rebuild()
rebuild in class com.fasterxml.jackson.core.JsonFactorypublic static SmileFactoryBuilder builder()
SmileFactory instances with
different configuration.public SmileFactory copy()
copy in class com.fasterxml.jackson.core.JsonFactorypublic void delegateToTextual(boolean state)
protected 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 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 canUseCharArrays()
canUseCharArrays in class com.fasterxml.jackson.core.JsonFactorypublic boolean canHandleBinaryNatively()
canHandleBinaryNatively in class com.fasterxml.jackson.core.JsonFactorypublic boolean canParseAsync()
canParseAsync in class com.fasterxml.jackson.core.JsonFactorypublic Class<SmileParser.Feature> getFormatReadFeatureType()
getFormatReadFeatureType in class com.fasterxml.jackson.core.JsonFactorypublic Class<SmileGenerator.Feature> getFormatWriteFeatureType()
getFormatWriteFeatureType in class com.fasterxml.jackson.core.JsonFactorypublic final SmileFactory configure(SmileParser.Feature f, boolean state)
SmileParser.Feature for list of features)public SmileFactory enable(SmileParser.Feature f)
SmileParser.Feature for list of features)public SmileFactory disable(SmileParser.Feature f)
SmileParser.Feature for list of features)public final boolean isEnabled(SmileParser.Feature f)
public int getFormatParserFeatures()
getFormatParserFeatures in class com.fasterxml.jackson.core.JsonFactorypublic final SmileFactory configure(SmileGenerator.Feature f, boolean state)
SmileGenerator.Feature for list of features)public SmileFactory enable(SmileGenerator.Feature f)
SmileGenerator.Feature for list of features)public SmileFactory disable(SmileGenerator.Feature f)
SmileGenerator.Feature for list of features)public final boolean isEnabled(SmileGenerator.Feature f)
public int getFormatGeneratorFeatures()
getFormatGeneratorFeatures in class com.fasterxml.jackson.core.JsonFactorypublic SmileParser createParser(File f) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic SmileParser createParser(URL url) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic SmileParser createParser(InputStream in) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic SmileParser createParser(byte[] data) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic SmileParser createParser(byte[] data, int offset, int len) throws IOException
createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic SmileGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
JsonGenerator for generating
Smile-encoded output.
Since Smile format always uses UTF-8 internally, enc
argument is ignored.
createGenerator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic SmileGenerator createGenerator(OutputStream out) throws IOException
JsonGenerator for generating
Smile-encoded output.
Since Smile format always uses UTF-8 internally, no encoding need to be passed to this method.
createGenerator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionpublic NonBlockingByteArrayParser createNonBlockingByteArrayParser() throws IOException
createNonBlockingByteArrayParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected SmileParser _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 SmileParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected com.fasterxml.jackson.core.JsonGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createGenerator in class com.fasterxml.jackson.core.JsonFactoryIOExceptionprotected com.fasterxml.jackson.core.JsonGenerator _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()
throws IOException
IOExceptionprotected <T> T _nonByteTarget()
throws IOException
IOExceptionprotected SmileGenerator _createGenerator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
IOExceptionCopyright © 2022 FasterXML. All rights reserved.