Top Fields Constructors Methods
com.fasterxml.jackson.dataformat.yaml

public Class YAMLFactory

extends JsonFactory
Class Inheritance
Annotations
@SuppressWarnings:resource
Imports
java.io.*, java.net.URL, com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.format.InputAccessor, .MatchStrength, com.fasterxml.jackson.core.io.IOContext, com.fasterxml.jackson.dataformat.yaml.util.StringQuotingChecker, org.yaml.snakeyaml.DumperOptions, .LoaderOptions

Field Summary

Modifier and TypeField and Description
protected final 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.Features).

protected final 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 final StringQuotingChecker
_quotingChecker

Helper object used to determine whether property names, String values must be quoted or not.

protected final DumperOptions.Version
_version

YAML version for underlying generator to follow, if specified.

protected int
protected int
protected static final int
DEFAULT_YAML_GENERATOR_FEATURE_FLAGS

Bitfield (set of flags) of all generator features that are enabled by default.

protected static final int
DEFAULT_YAML_PARSER_FEATURE_FLAGS

Bitfield (set of flags) of all parser features that are enabled by default.

public static final String
FORMAT_NAME_YAML

Name used to identify YAML format.

private static final long
private static final byte
private static final byte
private static final byte
Inherited from com.fasterxml.jackson.core.JsonFactory:
_byteSymbolCanonicalizer_characterEscapes_errorReportConfiguration_factoryFeatures_generatorDecorators_generatorFeatures_inputDecorator_maximumNonEscapedChar_objectCodec_outputDecorator_parserFeatures_quoteChar_recyclerPool_rootCharSymbols_rootValueSeparator_streamReadConstraints_streamWriteConstraintsDEFAULT_FACTORY_FEATURE_FLAGSDEFAULT_GENERATOR_FEATURE_FLAGSDEFAULT_PARSER_FEATURE_FLAGSDEFAULT_QUOTE_CHARDEFAULT_ROOT_VALUE_SEPARATORFORMAT_NAME_JSON

Constructor Summary

AccessConstructor and Description
public
YAMLFactory()

Default constructor used to create factory instances.

public
public
protected
YAMLFactory(YAMLFactoryBuilder b)

Constructors used by YAMLFactoryBuilder for instantiation.

Method Summary

Modifier and TypeMethod and Description
protected YAMLGenerator
_createGenerator(Writer
Writer underlying writer to write generated content to
out
,
IOContext
I/O context to use
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createGenerator.

Overridable factory method that actually instantiates generator for given Writer and context object.

protected YAMLParser
_createParser(InputStream
InputStream to use for reading content to parse
in
,
IOContext
I/O context to use for parsing
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates desired parser given InputStream and context object.

protected YAMLParser
_createParser(Reader
Reader to use for reading content to parse
r
,
IOContext
I/O context to use for parsing
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given Reader object for reading content.

protected YAMLParser
_createParser(char[]
Buffer that contains content to parse
data
,
int
Offset to the first character of data to parse
offset
,
int
Number of characters within buffer to parse
len
,
IOContext
I/O context to use for parsing
ctxt
,
boolean
Whether input buffer is recycled by the factory
recyclable
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given char[] object for accessing content.

protected YAMLParser
_createParser(byte[]
Buffer that contains content to parse
data
,
int
Offset to the first character of data to parse
offset
,
int
Number of characters within buffer to parse
len
,
IOContext
I/O context to use for parsing
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given Reader object for reading content passed as raw byte array.

protected Reader
protected Reader
_createReader(byte[] data, int offset, int len, JsonEncoding enc, IOContext ctxt)

protected YAMLGenerator
_createUTF8Generator(OutputStream
OutputStream underlying writer to write generated content to
out
,
IOContext
I/O context to use
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createUTF8Generator.

Overridable factory method that actually instantiates generator for given OutputStream and context object, using UTF-8 encoding.

protected Writer
public static YAMLFactoryBuilder
builder()

Hides com.fasterxml.jackson.core.JsonFactory.builder.

Main factory method to use for constructing YAMLFactory instances with different configuration.

public boolean
canUseCharArrays()

Overrides com.fasterxml.jackson.core.JsonFactory.canUseCharArrays.

Introspection method that can be used by base factory to check whether access using char[] is something that actual parser implementations can take advantage of, over having to use java.io.Reader.

public final YAMLFactory
configure(YAMLGenerator.Feature f, boolean state)

Method for enabling or disabling specified generator feature (check YAMLGenerator.Feature for list of features)

public final YAMLFactory
configure(YAMLParser.Feature f, boolean state)

Method for enabling or disabling specified parser feature (check YAMLParser.Feature for list of features)

public YAMLFactory
copy()

Overrides com.fasterxml.jackson.core.JsonFactory.copy.

Method for constructing a new JsonFactory that has the same settings as this instance, but is otherwise independent (i.e. nothing is actually shared, symbol tables are separate).

public YAMLGenerator
createGenerator(OutputStream
OutputStream to use for writing JSON content
out
,
JsonEncoding
Character encoding to use
enc
)

Overrides com.fasterxml.jackson.core.JsonFactory.createGenerator.

Method for constructing JSON generator for writing JSON content using specified output stream.

public YAMLGenerator
createGenerator(OutputStream out)

Overrides com.fasterxml.jackson.core.JsonFactory.createGenerator.

Convenience method for constructing generator that uses default encoding of the format (UTF-8 for JSON and most other data formats).

public YAMLGenerator
createGenerator(Writer
Writer to use for writing JSON content
out
)

Overrides com.fasterxml.jackson.core.JsonFactory.createGenerator.

Method for constructing JSON generator for writing JSON content using specified Writer.

public JsonGenerator
createGenerator(File
File to write contents to
f
,
JsonEncoding
Character encoding to use
enc
)

Overrides com.fasterxml.jackson.core.JsonFactory.createGenerator.

Method for constructing JSON generator for writing JSON content to specified file, overwriting contents it might have (or creating it if such file does not yet exist).

public YAMLParser
createParser(String content)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing parser for parsing contents of given String.

public YAMLParser
createParser(File
File that contains JSON content to parse
f
)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing JSON parser instance to parse contents of specified file.

public YAMLParser
createParser(URL
URL pointing to resource that contains JSON content to parse
url
)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing JSON parser instance to parse contents of resource reference by given URL.

public YAMLParser
createParser(InputStream
InputStream to use for reading JSON content to parse
in
)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing JSON parser instance to parse the contents accessed via specified input stream.

public YAMLParser
createParser(Reader
Reader to use for reading JSON content to parse
r
)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing parser for parsing the contents accessed via specified Reader.

public YAMLParser
createParser(char[] data)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing parser for parsing contents of given char array.

public YAMLParser
createParser(char[] data, int offset, int len)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing parser for parsing contents of given char array.

public YAMLParser
createParser(byte[] data)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing parser for parsing the contents of given byte array.

public YAMLParser
createParser(byte[]
Buffer that contains data to parse
data
,
int
Offset of the first data byte within buffer
offset
,
int
Length of contents to parse within buffer
len
)

Overrides com.fasterxml.jackson.core.JsonFactory.createParser.

Method for constructing parser for parsing the contents of given byte array.

public YAMLFactory
disable(YAMLGenerator.Feature f)

Method for disabling specified generator feature (check YAMLGenerator.Feature for list of features)

public YAMLFactory
disable(YAMLParser.Feature f)

Method for disabling specified parser features (check YAMLParser.Feature for list of features)

public YAMLFactory
enable(YAMLGenerator.Feature f)

Method for enabling specified generator features (check YAMLGenerator.Feature for list of features)

public YAMLFactory
enable(YAMLParser.Feature f)

Method for enabling specified parser feature (check YAMLParser.Feature for list of features)

public int
public String
getFormatName()

Overrides com.fasterxml.jackson.core.JsonFactory.getFormatName.

Method that returns short textual id identifying format this factory supports.

public int
public Class<YAMLParser.Feature>
getFormatReadFeatureType()

Overrides com.fasterxml.jackson.core.JsonFactory.getFormatReadFeatureType.

Method for accessing kind of FormatFeature that a parser JsonParser produced by this factory would accept, if any; null returned if none.

public Class<YAMLGenerator.Feature>
getFormatWriteFeatureType()

Overrides com.fasterxml.jackson.core.JsonFactory.getFormatWriteFeatureType.

Method for accessing kind of FormatFeature that a parser JsonGenerator produced by this factory would accept, if any; null returned if none.

public MatchStrength
hasFormat(InputAccessor acc)

Overrides com.fasterxml.jackson.core.JsonFactory.hasFormat.

Sub-classes need to override this method

public final boolean
isEnabled(YAMLGenerator.Feature f)

Check whether specified generator feature is enabled.

public final boolean
isEnabled(YAMLParser.Feature f)

Checked whether specified parser feature is enabled.

protected Object
readResolve()

Overrides com.fasterxml.jackson.core.JsonFactory.readResolve.

Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well.

public YAMLFactoryBuilder
rebuild()

Overrides com.fasterxml.jackson.core.JsonFactory.rebuild.

Method that allows construction of differently configured factory, starting with settings of this factory.

public Version
version()

Overrides com.fasterxml.jackson.core.JsonFactory.version.

Implements com.fasterxml.jackson.core.Versioned.version.

Method called to detect version of the component that implements this interface; returned version should never be null, but may return specific "not available" instance (see Version for details).

Inherited from com.fasterxml.jackson.core.JsonFactory:
_checkInvalidCopy_copy_createContentReference_createContentReference_createContext_createContext_createNonBlockingContext_createParser_decorate_decorate_decorate_decorate_decorate_decorate_getBufferRecycler_getRecyclerPoolcanHandleBinaryNativelycanParseAsynccanUseSchemaconfigureconfigureconfigurecreateGeneratorcreateGeneratorcreateJsonGeneratorcreateJsonGeneratorcreateJsonGeneratorcreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateNonBlockingByteArrayParsercreateNonBlockingByteBufferParsercreateParserdisabledisabledisableenableenableenablegetCharacterEscapesgetCodecgetFactoryFeaturesgetGeneratorFeaturesgetInputDecoratorgetOutputDecoratorgetParserFeaturesgetRootValueSeparatorhasJSONFormatisEnabledisEnabledisEnabledisEnabledisEnabledrequiresCustomCodecrequiresPropertyOrderingsetCharacterEscapessetCodecsetErrorReportConfigurationsetInputDecoratorsetOutputDecoratorsetRecyclerPoolsetRootValueSeparatorsetStreamReadConstraintssetStreamWriteConstraintsstreamReadConstraintsstreamWriteConstraints