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

public final Class TomlFactory

extends JsonFactory
Class Inheritance
Imports
java.io.CharArrayReader, .IOException, .InputStream, .OutputStream, .Reader, .Writer, com.fasterxml.jackson.core.FormatFeature, .FormatSchema, .JsonFactory, .JsonGenerator, .JsonParser, .ObjectCodec, .StreamReadFeature, .Version, com.fasterxml.jackson.core.format.InputAccessor, .MatchStrength, com.fasterxml.jackson.core.io.IOContext, .UTF8Writer, com.fasterxml.jackson.databind.node.ObjectNode, .TreeTraversingParser

Field Summary

Modifier and TypeField and Description
protected int
protected int
pack-priv static final int
DEFAULT_TOML_GENERATOR_FEATURE_FLAGS

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

pack-priv static final int
DEFAULT_TOML_PARSER_FEATURE_FLAGS

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

public static final String
private static final long
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
pack-priv
pack-priv
TomlFactory(TomlFactoryBuilder b)

Constructors used by TomlFactoryBuilder for instantiation.

Method Summary

Modifier and TypeMethod and Description
protected JsonGenerator
_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.

public JsonParser
_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.

public JsonParser
_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.

public JsonParser
_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 JsonParser
_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 JsonGenerator
_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.

public static TomlFactoryBuilder
builder()

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

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

public boolean
canParseAsync()

Overrides com.fasterxml.jackson.core.JsonFactory.canParseAsync.

Introspection method that can be used to check whether this factory can create non-blocking parsers: parsers that do not use blocking I/O abstractions but instead use a com.fasterxml.jackson.core.async.NonBlockingInputFeeder.

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 boolean
canUseSchema(FormatSchema
Schema instance to check
schema
)

Overrides com.fasterxml.jackson.core.JsonFactory.canUseSchema.

Method that can be used to quickly check whether given schema is something that parsers and/or generators constructed by this factory could use.

public final TomlFactory
configure(TomlReadFeature f, boolean state)

Method for enabling or disabling specified parser feature (check TomlReadFeature for list of features)

public final TomlFactory
configure(TomlWriteFeature f, boolean state)

Method for enabling or disabling specified generator feature (check TomlWriteFeature for list of features)

public TomlFactory
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 TomlFactory
disable(TomlReadFeature f)

Method for disabling specified parser features (check TomlReadFeature for list of features)

public TomlFactory
disable(TomlWriteFeature f)

Method for disabling specified generator features (check TomlWriteFeature for list of features)

public TomlFactory
enable(TomlReadFeature f)

Method for enabling specified parser feature (check TomlReadFeature for list of features)

public TomlFactory
enable(TomlWriteFeature f)

Method for enabling specified generator feature (check TomlWriteFeature 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<? extends FormatFeature>
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<? extends FormatFeature>
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
public final boolean
isEnabled(TomlReadFeature f)

Checked whether specified parser feature is enabled.

public final boolean
isEnabled(TomlWriteFeature f)

Checked whether specified generator feature is enabled.

private ObjectNode
public TomlFactoryBuilder
rebuild()

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

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

public boolean
requiresPropertyOrdering()

Overrides com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering.

Introspection method that higher-level functionality may call to see whether underlying data format requires a stable ordering of object properties or not.

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_createWriter_decorate_decorate_decorate_decorate_decorate_decorate_getBufferRecycler_getRecyclerPoolcanHandleBinaryNativelyconfigureconfigureconfigurecreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateJsonGeneratorcreateJsonGeneratorcreateJsonGeneratorcreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateJsonParsercreateNonBlockingByteArrayParsercreateNonBlockingByteBufferParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParserdisabledisabledisableenableenableenablegetCharacterEscapesgetCodecgetFactoryFeaturesgetGeneratorFeaturesgetInputDecoratorgetOutputDecoratorgetParserFeaturesgetRootValueSeparatorhasJSONFormatisEnabledisEnabledisEnabledisEnabledisEnabledreadResolverequiresCustomCodecsetCharacterEscapessetCodecsetErrorReportConfigurationsetInputDecoratorsetOutputDecoratorsetRecyclerPoolsetRootValueSeparatorsetStreamReadConstraintssetStreamWriteConstraintsstreamReadConstraintsstreamWriteConstraints

Field Detail

_tomlGeneratorFeaturesback to summary
protected int _tomlGeneratorFeatures
_tomlParserFeaturesback to summary
protected int _tomlParserFeatures
DEFAULT_TOML_GENERATOR_FEATURE_FLAGSback to summary
pack-priv static final int DEFAULT_TOML_GENERATOR_FEATURE_FLAGS

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

DEFAULT_TOML_PARSER_FEATURE_FLAGSback to summary
pack-priv static final int DEFAULT_TOML_PARSER_FEATURE_FLAGS

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

FORMAT_NAME_TOMLback to summary
public static final String FORMAT_NAME_TOML
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.JsonFactory.serialVersionUID.

Constructor Detail

TomlFactoryback to summary
public TomlFactory()
TomlFactoryback to summary
pack-priv TomlFactory(TomlFactory src, ObjectCodec oc)
TomlFactoryback to summary
pack-priv TomlFactory(TomlFactoryBuilder b)

Constructors used by TomlFactoryBuilder for instantiation.

Since
3.0

Method Detail

_createGeneratorback to summary
protected JsonGenerator _createGenerator(Writer out, IOContext ctxt) throws IOException

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

Doc from com.fasterxml.jackson.core.JsonFactory._createGenerator.

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

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
out:Writer

Writer underlying writer to write generated content to

ctxt:IOContext

I/O context to use

Returns:JsonGenerator

This factory instance (to allow call chaining)

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (write) problem
_createParserback to summary
public JsonParser _createParser(InputStream in, IOContext ctxt) throws IOException

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

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

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

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
in:InputStream

InputStream to use for reading content to parse

ctxt:IOContext

I/O context to use for parsing

Returns:JsonParser

Parser constructed

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createParserback to summary
public JsonParser _createParser(Reader r, IOContext ctxt) throws IOException

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

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

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

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
r:Reader

Reader to use for reading content to parse

ctxt:IOContext

I/O context to use for parsing

Returns:JsonParser

Actual parser to use

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createParserback to summary
public JsonParser _createParser(byte[] data, int offset, int len, IOContext ctxt) throws IOException

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

Doc from 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.

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
data:byte[]

Buffer that contains content to parse

offset:int

Offset to the first character of data to parse

len:int

Number of characters within buffer to parse

ctxt:IOContext

I/O context to use for parsing

Returns:JsonParser

Actual parser to use

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createParserback to summary
protected JsonParser _createParser(char[] data, int offset, int len, IOContext ctxt, boolean recyclable) throws IOException

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

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

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

Parameters
data:char[]

Buffer that contains content to parse

offset:int

Offset to the first character of data to parse

len:int

Number of characters within buffer to parse

ctxt:IOContext

I/O context to use for parsing

recyclable:boolean

Whether input buffer is recycled by the factory

Returns:JsonParser

Actual parser to use

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createUTF8Generatorback to summary
protected JsonGenerator _createUTF8Generator(OutputStream out, IOContext ctxt) throws IOException

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

Doc from com.fasterxml.jackson.core.JsonFactory._createUTF8Generator.

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

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
out:OutputStream

OutputStream underlying writer to write generated content to

ctxt:IOContext

I/O context to use

Returns:JsonGenerator

This factory instance (to allow call chaining)

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (write) problem
builderback to summary
public static TomlFactoryBuilder builder()

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

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

Returns:TomlFactoryBuilder

Doc from com.fasterxml.jackson.core.JsonFactory.builder.

Builder instance to use

canParseAsyncback to summary
public boolean canParseAsync()

Overrides com.fasterxml.jackson.core.JsonFactory.canParseAsync.

Doc from com.fasterxml.jackson.core.JsonFactory.canParseAsync.

Introspection method that can be used to check whether this factory can create non-blocking parsers: parsers that do not use blocking I/O abstractions but instead use a com.fasterxml.jackson.core.async.NonBlockingInputFeeder.

Returns:boolean

Whether this factory supports non-blocking ("async") parsing or not (and consequently whether createNonBlockingXxx() method(s) work)

Annotations
@Override
canUseCharArraysback to summary
public boolean canUseCharArrays()

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

Doc from 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. Sub-types are expected to override definition; default implementation (suitable for JSON) alleges that optimization are possible; and thereby is likely to try to access java.lang.String content by first copying it into recyclable intermediate buffer.

Returns:boolean

Whether access to decoded textual content can be efficiently accessed using parser method getTextCharacters().

Annotations
@Override
canUseSchemaback to summary
public boolean canUseSchema(FormatSchema schema)

Overrides com.fasterxml.jackson.core.JsonFactory.canUseSchema.

Doc from com.fasterxml.jackson.core.JsonFactory.canUseSchema.

Method that can be used to quickly check whether given schema is something that parsers and/or generators constructed by this factory could use. Note that this means possible use, at the level of data format (i.e. schema is for same data format as parsers and generators this factory constructs); individual schema instances may have further usage restrictions.

Parameters
schema:FormatSchema

Schema instance to check

Returns:boolean

Whether parsers and generators constructed by this factory can use specified format schema instance

Annotations
@Override
configureback to summary
public final TomlFactory configure(TomlReadFeature f, boolean state)

Method for enabling or disabling specified parser feature (check TomlReadFeature for list of features)

configureback to summary
public final TomlFactory configure(TomlWriteFeature f, boolean state)

Method for enabling or disabling specified generator feature (check TomlWriteFeature for list of features)

copyback to summary
public TomlFactory copy()

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

Doc from 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). Note that ObjectCodec reference is not copied but is set to null; caller typically needs to set it after calling this method. Reason for this is that the codec is used for callbacks, and assumption is that there is strict 1-to-1 mapping between codec, factory. Caller has to, then, explicitly set codec after making the copy.

Returns:TomlFactory

Copy of this factory instance

Annotations
@Override
disableback to summary
public TomlFactory disable(TomlReadFeature f)

Method for disabling specified parser features (check TomlReadFeature for list of features)

disableback to summary
public TomlFactory disable(TomlWriteFeature f)

Method for disabling specified generator features (check TomlWriteFeature for list of features)

enableback to summary
public TomlFactory enable(TomlReadFeature f)

Method for enabling specified parser feature (check TomlReadFeature for list of features)

enableback to summary
public TomlFactory enable(TomlWriteFeature f)

Method for enabling specified generator feature (check TomlWriteFeature for list of features)

getFormatGeneratorFeaturesback to summary
public int getFormatGeneratorFeatures()

Overrides com.fasterxml.jackson.core.JsonFactory.getFormatGeneratorFeatures.

Annotations
@Override
getFormatNameback to summary
public String getFormatName()

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

Doc from com.fasterxml.jackson.core.JsonFactory.getFormatName.

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

Note

sub-classes should override this method; default implementation will return null for all sub-classes

Returns:String

Name of the format handled by parsers, generators this factory creates

Annotations
@Override
getFormatParserFeaturesback to summary
public int getFormatParserFeatures()

Overrides com.fasterxml.jackson.core.JsonFactory.getFormatParserFeatures.

Annotations
@Override
getFormatReadFeatureTypeback to summary
public Class<? extends FormatFeature> getFormatReadFeatureType()

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

Doc from com.fasterxml.jackson.core.TokenStreamFactory.getFormatReadFeatureType.

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

Returns:Class<? extends FormatFeature>

Type of format-specific stream read features, if any; null if none

Annotations
@Override
getFormatWriteFeatureTypeback to summary
public Class<? extends FormatFeature> getFormatWriteFeatureType()

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

Doc from com.fasterxml.jackson.core.TokenStreamFactory.getFormatWriteFeatureType.

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

Returns:Class<? extends FormatFeature>

Type of format-specific stream read features, if any; null if none

Annotations
@Override
hasFormatback to summary
public MatchStrength hasFormat(InputAccessor acc) throws IOException

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

Annotations
@Override
isEnabledback to summary
public final boolean isEnabled(TomlReadFeature f)

Checked whether specified parser feature is enabled.

isEnabledback to summary
public final boolean isEnabled(TomlWriteFeature f)

Checked whether specified generator feature is enabled.

parseback to summary
private ObjectNode parse(IOContext ctxt, Reader r0) throws IOException
rebuildback to summary
public TomlFactoryBuilder rebuild()

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

Doc from com.fasterxml.jackson.core.JsonFactory.rebuild.

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

Returns:TomlFactoryBuilder

Builder instance to use

Annotations
@Override
requiresPropertyOrderingback to summary
public boolean requiresPropertyOrdering()

Overrides com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering.

Doc from com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering.

Introspection method that higher-level functionality may call to see whether underlying data format requires a stable ordering of object properties or not. This is usually used for determining whether to force a stable ordering (like alphabetic ordering by name) if no ordering if explicitly specified.

Default implementation returns false as JSON does NOT require stable ordering. Formats that require ordering include positional textual formats like CSV, and schema-based binary formats like Avro.

Returns:boolean

Whether format supported by this factory requires Object properties to be ordered.

Annotations
@Override
versionback to summary
public Version version()

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

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

Doc from 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).

Returns:Version

Version of the component

Annotations
@Override