|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.fasterxml.jackson.core.JsonFactory
com.fasterxml.jackson.dataformat.smile.SmileFactory
public class SmileFactory
Factory used for constructing 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).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonFactory |
|---|
com.fasterxml.jackson.core.JsonFactory.Feature |
| Field Summary | |
|---|---|
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. |
| Fields inherited from class com.fasterxml.jackson.core.JsonFactory |
|---|
_characterEscapes, _factoryFeatures, _generatorFeatures, _inputDecorator, _objectCodec, _outputDecorator, _parserFeatures, _recyclerRef, _rootByteSymbols, _rootCharSymbols, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, FORMAT_NAME_JSON |
| Constructor Summary | |
|---|---|
SmileFactory()
Default constructor used to create factory instances. |
|
SmileFactory(com.fasterxml.jackson.core.ObjectCodec oc)
|
|
| Method Summary | |
|---|---|
protected SmileGenerator |
_createJsonGenerator(OutputStream out,
com.fasterxml.jackson.core.io.IOContext ctxt)
|
protected com.fasterxml.jackson.core.JsonGenerator |
_createJsonGenerator(Writer out,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired generator. |
protected SmileParser |
_createJsonParser(byte[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired parser. |
protected SmileParser |
_createJsonParser(InputStream in,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired parser. |
protected com.fasterxml.jackson.core.JsonParser |
_createJsonParser(Reader r,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired parser. |
protected Writer |
_createWriter(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc,
com.fasterxml.jackson.core.io.IOContext ctxt)
|
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) |
SmileGenerator |
createJsonGenerator(OutputStream out)
Since Smile format always uses UTF-8 internally, no encoding need to be passed to this method. |
SmileGenerator |
createJsonGenerator(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc)
note: co-variant return type |
SmileParser |
createJsonParser(byte[] data)
|
SmileParser |
createJsonParser(byte[] data,
int offset,
int len)
|
SmileParser |
createJsonParser(File f)
|
SmileParser |
createJsonParser(InputStream in)
|
SmileParser |
createJsonParser(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) |
String |
getFormatName()
|
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. |
com.fasterxml.jackson.core.Version |
version()
|
| Methods inherited from class com.fasterxml.jackson.core.JsonFactory |
|---|
_createContext, _createUTF8JsonGenerator, _getBufferRecycler, _optimizedStreamFromURL, configure, configure, configure, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getCodec, getInputDecorator, getOutputDecorator, hasJSONFormat, isEnabled, isEnabled, isEnabled, setCharacterEscapes, setCodec, setInputDecorator, setOutputDecorator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public SmileFactory()
public SmileFactory(com.fasterxml.jackson.core.ObjectCodec oc)
| Method Detail |
|---|
public void delegateToTextual(boolean state)
public 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.JsonFactory
public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
throws IOException
hasFormat in class com.fasterxml.jackson.core.JsonFactoryIOException
public 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 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 SmileParser createJsonParser(File f)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
public SmileParser createJsonParser(URL url)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
public SmileParser createJsonParser(InputStream in)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
public SmileParser createJsonParser(byte[] data)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
public SmileParser createJsonParser(byte[] data,
int offset,
int len)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
public SmileGenerator createJsonGenerator(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc)
throws IOException
note: co-variant return type
createJsonGenerator in class com.fasterxml.jackson.core.JsonFactoryIOException
public SmileGenerator createJsonGenerator(OutputStream out)
throws IOException
createJsonGenerator in class com.fasterxml.jackson.core.JsonFactoryIOException
protected SmileParser _createJsonParser(InputStream in,
com.fasterxml.jackson.core.io.IOContext ctxt)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
_createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
protected com.fasterxml.jackson.core.JsonParser _createJsonParser(Reader r,
com.fasterxml.jackson.core.io.IOContext ctxt)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
_createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
protected SmileParser _createJsonParser(byte[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
_createJsonParser in class com.fasterxml.jackson.core.JsonFactoryIOException
com.fasterxml.jackson.core.JsonParseException
protected com.fasterxml.jackson.core.JsonGenerator _createJsonGenerator(Writer out,
com.fasterxml.jackson.core.io.IOContext ctxt)
throws IOException
_createJsonGenerator in class com.fasterxml.jackson.core.JsonFactoryIOException
protected 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.JsonFactoryIOException
protected SmileGenerator _createJsonGenerator(OutputStream out,
com.fasterxml.jackson.core.io.IOContext ctxt)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||