Class YAMLFactory
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonFactory
-
- com.fasterxml.jackson.dataformat.yaml.YAMLFactory
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned,Serializable
public class YAMLFactory extends com.fasterxml.jackson.core.JsonFactory- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.yaml.snakeyaml.DumperOptions.Version_versionprotected int_yamlGeneratorFeaturesprotected int_yamlParserFeaturesprotected static intDEFAULT_YAML_GENERATOR_FEATURE_FLAGSBitfield (set of flags) of all generator features that are enabled by default.protected static intDEFAULT_YAML_PARSER_FEATURE_FLAGSBitfield (set of flags) of all parser features that are enabled by default.static StringFORMAT_NAME_YAMLName used to identify YAML format.protected CharsetUTF8-
Fields inherited from class com.fasterxml.jackson.core.JsonFactory
_byteSymbolCanonicalizer, _characterEscapes, _factoryFeatures, _generatorFeatures, _inputDecorator, _objectCodec, _outputDecorator, _parserFeatures, _rootCharSymbols, _rootValueSeparator, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, FORMAT_NAME_JSON
-
-
Constructor Summary
Constructors Constructor Description YAMLFactory()Default constructor used to create factory instances.YAMLFactory(com.fasterxml.jackson.core.ObjectCodec oc)YAMLFactory(YAMLFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected YAMLGenerator_createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt)protected YAMLParser_createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt)protected YAMLParser_createParser(char[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt, boolean recyclable)protected YAMLParser_createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt)protected YAMLParser_createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt)protected Reader_createReader(byte[] data, int offset, int len, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt)protected Reader_createReader(InputStream in, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt)protected YAMLGenerator_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)booleancanUseCharArrays()YAMLFactoryconfigure(YAMLGenerator.Feature f, boolean state)Method for enabling or disabling specified generator feature (checkYAMLGenerator.Featurefor list of features)YAMLFactoryconfigure(YAMLParser.Feature f, boolean state)Method for enabling or disabling specified parser feature (checkYAMLParser.Featurefor list of features)YAMLFactorycopy()com.fasterxml.jackson.core.JsonGeneratorcreateGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc)YAMLGeneratorcreateGenerator(OutputStream out)YAMLGeneratorcreateGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc)YAMLGeneratorcreateGenerator(Writer out)YAMLParsercreateParser(byte[] data)YAMLParsercreateParser(byte[] data, int offset, int len)YAMLParsercreateParser(char[] data)YAMLParsercreateParser(char[] data, int offset, int len)YAMLParsercreateParser(File f)YAMLParsercreateParser(InputStream in)YAMLParsercreateParser(Reader r)YAMLParsercreateParser(String content)YAMLParsercreateParser(URL url)YAMLFactorydisable(YAMLGenerator.Feature f)Method for disabling specified generator feature (checkYAMLGenerator.Featurefor list of features)YAMLFactorydisable(YAMLParser.Feature f)Method for disabling specified parser features (checkYAMLParser.Featurefor list of features)YAMLFactoryenable(YAMLGenerator.Feature f)Method for enabling specified generator features (checkYAMLGenerator.Featurefor list of features)YAMLFactoryenable(YAMLParser.Feature f)Method for enabling specified parser feature (checkYAMLParser.Featurefor list of features)StringgetFormatName()com.fasterxml.jackson.core.format.MatchStrengthhasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)Sub-classes need to override this method (as of 1.8)booleanisEnabled(YAMLGenerator.Feature f)Check whether specified generator feature is enabled.booleanisEnabled(YAMLParser.Feature f)Checked whether specified parser feature is enabled.protected ObjectreadResolve()Method that we need to override to actually make restoration go through constructors etc.com.fasterxml.jackson.core.Versionversion()-
Methods inherited from class com.fasterxml.jackson.core.JsonFactory
_checkInvalidCopy, _createContext, _createDataOutputWrapper, _createNonBlockingContext, _createParser, _decorate, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, _optimizedStreamFromURL, canHandleBinaryNatively, canParseAsync, canUseSchema, configure, configure, configure, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteArrayParser, createParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getCodec, getFormatReadFeatureType, getFormatWriteFeatureType, getInputDecorator, getOutputDecorator, getRootValueSeparator, hasJSONFormat, isEnabled, isEnabled, isEnabled, requiresCustomCodec, requiresPropertyOrdering, setCharacterEscapes, setCodec, setInputDecorator, setOutputDecorator, setRootValueSeparator
-
-
-
-
Field Detail
-
FORMAT_NAME_YAML
public static final String FORMAT_NAME_YAML
Name used to identify YAML format. (and returned bygetFormatName()- See Also:
- Constant Field Values
-
DEFAULT_YAML_PARSER_FEATURE_FLAGS
protected static final int DEFAULT_YAML_PARSER_FEATURE_FLAGS
Bitfield (set of flags) of all parser features that are enabled by default.
-
DEFAULT_YAML_GENERATOR_FEATURE_FLAGS
protected static final int DEFAULT_YAML_GENERATOR_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled by default.
-
_yamlParserFeatures
protected int _yamlParserFeatures
-
_yamlGeneratorFeatures
protected int _yamlGeneratorFeatures
-
_version
protected org.yaml.snakeyaml.DumperOptions.Version _version
-
UTF8
protected final Charset UTF8
-
-
Constructor Detail
-
YAMLFactory
public YAMLFactory()
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.
-
YAMLFactory
public YAMLFactory(com.fasterxml.jackson.core.ObjectCodec oc)
-
YAMLFactory
public YAMLFactory(YAMLFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
- Since:
- 2.2.1
-
-
Method Detail
-
copy
public YAMLFactory copy()
- Overrides:
copyin classcom.fasterxml.jackson.core.JsonFactory
-
readResolve
protected Object readResolve()
Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well.- Overrides:
readResolvein classcom.fasterxml.jackson.core.JsonFactory
-
version
public com.fasterxml.jackson.core.Version version()
- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Overrides:
versionin classcom.fasterxml.jackson.core.JsonFactory
-
canUseCharArrays
public boolean canUseCharArrays()
- Overrides:
canUseCharArraysin classcom.fasterxml.jackson.core.JsonFactory
-
getFormatName
public String getFormatName()
- Overrides:
getFormatNamein classcom.fasterxml.jackson.core.JsonFactory
-
hasFormat
public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) throws IOExceptionSub-classes need to override this method (as of 1.8)- Overrides:
hasFormatin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
configure
public final YAMLFactory configure(YAMLParser.Feature f, boolean state)
Method for enabling or disabling specified parser feature (checkYAMLParser.Featurefor list of features)
-
enable
public YAMLFactory enable(YAMLParser.Feature f)
Method for enabling specified parser feature (checkYAMLParser.Featurefor list of features)
-
disable
public YAMLFactory disable(YAMLParser.Feature f)
Method for disabling specified parser features (checkYAMLParser.Featurefor list of features)
-
isEnabled
public final boolean isEnabled(YAMLParser.Feature f)
Checked whether specified parser feature is enabled.
-
configure
public final YAMLFactory configure(YAMLGenerator.Feature f, boolean state)
Method for enabling or disabling specified generator feature (checkYAMLGenerator.Featurefor list of features)
-
enable
public YAMLFactory enable(YAMLGenerator.Feature f)
Method for enabling specified generator features (checkYAMLGenerator.Featurefor list of features)
-
disable
public YAMLFactory disable(YAMLGenerator.Feature f)
Method for disabling specified generator feature (checkYAMLGenerator.Featurefor list of features)
-
isEnabled
public final boolean isEnabled(YAMLGenerator.Feature f)
Check whether specified generator feature is enabled.
-
createParser
public YAMLParser createParser(String content) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(File f) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(URL url) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(InputStream in) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(Reader r) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(char[] data) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(char[] data, int offset, int len) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(byte[] data) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
public YAMLParser createParser(byte[] data, int offset, int len) throws IOException
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
public YAMLGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
- Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
public YAMLGenerator createGenerator(OutputStream out) throws IOException
- Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
public YAMLGenerator createGenerator(Writer out) throws IOException
- Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
public com.fasterxml.jackson.core.JsonGenerator createGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
- Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createParser
protected YAMLParser _createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Overrides:
_createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createParser
protected YAMLParser _createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Overrides:
_createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createParser
protected YAMLParser _createParser(char[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt, boolean recyclable) throws IOException
- Overrides:
_createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createParser
protected YAMLParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Overrides:
_createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createGenerator
protected YAMLGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Overrides:
_createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createUTF8Generator
protected YAMLGenerator _createUTF8Generator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Overrides:
_createUTF8Generatorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createWriter
protected Writer _createWriter(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Overrides:
_createWriterin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createReader
protected Reader _createReader(InputStream in, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Throws:
IOException
-
_createReader
protected Reader _createReader(byte[] data, int offset, int len, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
- Throws:
IOException
-
-