public class YAMLFactory
extends com.fasterxml.jackson.core.JsonFactory
Modifier and Type | Field and Description |
---|---|
protected org.yaml.snakeyaml.DumperOptions |
_dumperOptions
Configuration for underlying generator to follow, if specified;
left as
null for backwards compatibility (which means
the dumper options are derived based on YAMLGenerator.Feature s). |
protected org.yaml.snakeyaml.LoaderOptions |
_loaderOptions
Configuration for underlying parser to follow, if specified;
left as
null for backwards compatibility (which means
whatever default settings SnakeYAML deems best). |
protected StringQuotingChecker |
_quotingChecker
Helper object used to determine whether property names, String values
must be quoted or not.
|
protected org.yaml.snakeyaml.DumperOptions.Version |
_version
YAML version for underlying generator to follow, if specified.
|
protected int |
_yamlGeneratorFeatures |
protected int |
_yamlParserFeatures |
protected static int |
DEFAULT_YAML_GENERATOR_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled
by default.
|
protected static int |
DEFAULT_YAML_PARSER_FEATURE_FLAGS
Bitfield (set of flags) of all parser features that are enabled
by default.
|
static String |
FORMAT_NAME_YAML
Name used to identify YAML 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 |
---|---|
|
YAMLFactory()
Default constructor used to create factory instances.
|
|
YAMLFactory(com.fasterxml.jackson.core.ObjectCodec oc) |
protected |
YAMLFactory(YAMLFactoryBuilder b)
Constructors used by
YAMLFactoryBuilder for instantiation. |
|
YAMLFactory(YAMLFactory src,
com.fasterxml.jackson.core.ObjectCodec oc) |
Modifier and Type | Method and 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) |
static YAMLFactoryBuilder |
builder()
Main factory method to use for constructing
YAMLFactory instances with
different configuration. |
boolean |
canUseCharArrays() |
YAMLFactory |
configure(YAMLGenerator.Feature f,
boolean state)
Method for enabling or disabling specified generator feature
(check
YAMLGenerator.Feature for list of features) |
YAMLFactory |
configure(YAMLParser.Feature f,
boolean state)
Method for enabling or disabling specified parser feature
(check
YAMLParser.Feature for list of features) |
YAMLFactory |
copy() |
com.fasterxml.jackson.core.JsonGenerator |
createGenerator(File f,
com.fasterxml.jackson.core.JsonEncoding enc) |
YAMLGenerator |
createGenerator(OutputStream out) |
YAMLGenerator |
createGenerator(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc) |
YAMLGenerator |
createGenerator(Writer out) |
YAMLParser |
createParser(byte[] data) |
YAMLParser |
createParser(byte[] data,
int offset,
int len) |
YAMLParser |
createParser(char[] data) |
YAMLParser |
createParser(char[] data,
int offset,
int len) |
YAMLParser |
createParser(File f) |
YAMLParser |
createParser(InputStream in) |
YAMLParser |
createParser(Reader r) |
YAMLParser |
createParser(String content) |
YAMLParser |
createParser(URL url) |
YAMLFactory |
disable(YAMLGenerator.Feature f)
Method for disabling specified generator feature
(check
YAMLGenerator.Feature for list of features) |
YAMLFactory |
disable(YAMLParser.Feature f)
Method for disabling specified parser features
(check
YAMLParser.Feature for list of features) |
YAMLFactory |
enable(YAMLGenerator.Feature f)
Method for enabling specified generator features
(check
YAMLGenerator.Feature for list of features) |
YAMLFactory |
enable(YAMLParser.Feature f)
Method for enabling specified parser feature
(check
YAMLParser.Feature for list of features) |
int |
getFormatGeneratorFeatures() |
String |
getFormatName() |
int |
getFormatParserFeatures() |
Class<YAMLParser.Feature> |
getFormatReadFeatureType() |
Class<YAMLGenerator.Feature> |
getFormatWriteFeatureType() |
com.fasterxml.jackson.core.format.MatchStrength |
hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
Sub-classes need to override this method
|
boolean |
isEnabled(YAMLGenerator.Feature f)
Check whether specified generator feature is enabled.
|
boolean |
isEnabled(YAMLParser.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.
|
YAMLFactoryBuilder |
rebuild() |
com.fasterxml.jackson.core.Version |
version() |
_checkInvalidCopy, _createContentReference, _createContentReference, _createContext, _createContext, _createNonBlockingContext, _createParser, _decorate, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, canHandleBinaryNatively, canParseAsync, canUseSchema, configure, configure, configure, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteArrayParser, createNonBlockingByteBufferParser, 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, setRootValueSeparator
public static final String FORMAT_NAME_YAML
getFormatName()
protected static final int DEFAULT_YAML_PARSER_FEATURE_FLAGS
protected static final int DEFAULT_YAML_GENERATOR_FEATURE_FLAGS
protected int _yamlParserFeatures
protected int _yamlGeneratorFeatures
protected final org.yaml.snakeyaml.DumperOptions.Version _version
protected final StringQuotingChecker _quotingChecker
protected final org.yaml.snakeyaml.LoaderOptions _loaderOptions
null
for backwards compatibility (which means
whatever default settings SnakeYAML
deems best).
If you need to support parsing YAML files that are larger than 3Mb, it is recommended that you provide a LoaderOptions instance where you set the Codepoint Limit to a larger value than its 3Mb default.
protected final org.yaml.snakeyaml.DumperOptions _dumperOptions
null
for backwards compatibility (which means
the dumper options are derived based on YAMLGenerator.Feature
s).
These YAMLGenerator.Feature
s are ignored if you provide your own DumperOptions:
YAMLGenerator.Feature.ALLOW_LONG_KEYS
YAMLGenerator.Feature.CANONICAL_OUTPUT
YAMLGenerator.Feature.INDENT_ARRAYS
YAMLGenerator.Feature.INDENT_ARRAYS_WITH_INDICATOR
YAMLGenerator.Feature.SPLIT_LINES
YAMLGenerator.Feature.USE_PLATFORM_LINE_BREAKS
public YAMLFactory()
public YAMLFactory(com.fasterxml.jackson.core.ObjectCodec oc)
public YAMLFactory(YAMLFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
protected YAMLFactory(YAMLFactoryBuilder b)
YAMLFactoryBuilder
for instantiation.public YAMLFactoryBuilder rebuild()
rebuild
in class com.fasterxml.jackson.core.JsonFactory
public static YAMLFactoryBuilder builder()
YAMLFactory
instances with
different configuration.public YAMLFactory copy()
copy
in class com.fasterxml.jackson.core.JsonFactory
protected Object readResolve()
readResolve
in class com.fasterxml.jackson.core.JsonFactory
public com.fasterxml.jackson.core.Version version()
version
in interface com.fasterxml.jackson.core.Versioned
version
in class com.fasterxml.jackson.core.JsonFactory
public boolean canUseCharArrays()
canUseCharArrays
in class com.fasterxml.jackson.core.JsonFactory
public Class<YAMLParser.Feature> getFormatReadFeatureType()
getFormatReadFeatureType
in class com.fasterxml.jackson.core.JsonFactory
public Class<YAMLGenerator.Feature> getFormatWriteFeatureType()
getFormatWriteFeatureType
in class com.fasterxml.jackson.core.JsonFactory
public 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.JsonFactory
IOException
public final YAMLFactory configure(YAMLParser.Feature f, boolean state)
YAMLParser.Feature
for list of features)public YAMLFactory enable(YAMLParser.Feature f)
YAMLParser.Feature
for list of features)public YAMLFactory disable(YAMLParser.Feature f)
YAMLParser.Feature
for list of features)public final boolean isEnabled(YAMLParser.Feature f)
public int getFormatParserFeatures()
getFormatParserFeatures
in class com.fasterxml.jackson.core.JsonFactory
public final YAMLFactory configure(YAMLGenerator.Feature f, boolean state)
YAMLGenerator.Feature
for list of features)public YAMLFactory enable(YAMLGenerator.Feature f)
YAMLGenerator.Feature
for list of features)public YAMLFactory disable(YAMLGenerator.Feature f)
YAMLGenerator.Feature
for list of features)public final boolean isEnabled(YAMLGenerator.Feature f)
public int getFormatGeneratorFeatures()
getFormatGeneratorFeatures
in class com.fasterxml.jackson.core.JsonFactory
public YAMLParser createParser(String content) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(File f) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(URL url) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(InputStream in) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(Reader r) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(char[] data) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(char[] data, int offset, int len) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(byte[] data) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLParser createParser(byte[] data, int offset, int len) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLGenerator createGenerator(OutputStream out) throws IOException
createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
public YAMLGenerator createGenerator(Writer out) throws IOException
createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
public com.fasterxml.jackson.core.JsonGenerator createGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected YAMLParser _createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected YAMLParser _createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected YAMLParser _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.JsonFactory
IOException
protected YAMLParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected YAMLGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected YAMLGenerator _createUTF8Generator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createUTF8Generator
in class com.fasterxml.jackson.core.JsonFactory
IOException
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.JsonFactory
IOException
protected Reader _createReader(InputStream in, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
IOException
protected Reader _createReader(byte[] data, int offset, int len, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
IOException
Copyright © 2022 FasterXML. All rights reserved.