Top Description Fields Constructors Methods
tools.jackson.dataformat.yaml

public final Enum YAMLWriteFeature

extends Enum<YAMLWriteFeature>
implements FormatFeature
Class Inheritance
All Implemented Interfaces
tools.jackson.core.FormatFeature, tools.jackson.core.util.JacksonFeature
Imports
tools.jackson.core.FormatFeature

Enumeration that defines all togglable features for YAML generators

Note

in Jackson 2.x this was named YAMLGenerator.Feature.

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
public static final YAMLWriteFeature
ALLOW_LONG_KEYS

Option passed to SnakeYAML to allows writing key longer that 128 characters (up to 1024 characters).

public static final YAMLWriteFeature
ALWAYS_QUOTE_NUMBERS_AS_STRINGS

Whether numbers stored as strings will be rendered with quotes (true) or without quotes (false, default) when MINIMIZE_QUOTES is enabled.

public static final YAMLWriteFeature
CANONICAL_OUTPUT

Do we try to force so-called canonical output or not.

public static final YAMLWriteFeature
INDENT_ARRAYS

Feature enabling of which adds indentation for array entry generation (default indentation being 2 spaces).

public static final YAMLWriteFeature
INDENT_ARRAYS_WITH_INDICATOR

Feature enabling of which adds indentation with indicator for array entry generation (default indentation being 2 spaces).

public static final YAMLWriteFeature
LITERAL_BLOCK_STYLE

Whether for string containing newlines a literal block style should be used.

public static final YAMLWriteFeature
MINIMIZE_QUOTES

Whether strings will be rendered without quotes (true) or with quotes (false, default).

public static final YAMLWriteFeature
SPLIT_LINES

Options passed to SnakeYAML that determines whether longer textual content gets automatically split into multiple lines or not.

public static final YAMLWriteFeature
USE_NATIVE_OBJECT_ID

Whether to use YAML native Object Id construct for indicating type (true); or "generic" Object Id mechanism (false).

public static final YAMLWriteFeature
USE_NATIVE_TYPE_ID

Whether to use YAML native Type Id construct for indicating type (true); or "generic" type property (false).

public static final YAMLWriteFeature
WRITE_DOC_START_MARKER

Whether we are to write an explicit document start marker ("---") or not.

Constructor Summary

AccessConstructor and Description
private
YAMLWriteFeature(boolean defaultState)

Method Summary

Modifier and TypeMethod and Description
public static int
collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

public boolean
enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

public int
getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

public static YAMLWriteFeature
public static YAMLWriteFeature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_defaultStateback to summary
private final boolean _defaultState
_maskback to summary
private final int _mask
ALLOW_LONG_KEYSback to summary
public static final YAMLWriteFeature ALLOW_LONG_KEYS

Option passed to SnakeYAML to allows writing key longer that 128 characters (up to 1024 characters). If disabled, the max key length is left as 128 characters: longer names are truncated. If enabled, limit is raised to 1024 characters.

Ignored if you provide your own DumperOptions.

ALWAYS_QUOTE_NUMBERS_AS_STRINGSback to summary
public static final YAMLWriteFeature ALWAYS_QUOTE_NUMBERS_AS_STRINGS

Whether numbers stored as strings will be rendered with quotes (true) or without quotes (false, default) when MINIMIZE_QUOTES is enabled.

Minimized quote usage makes for more human readable output; however, content is limited to printable characters according to the rules of literal block style.

CANONICAL_OUTPUTback to summary
public static final YAMLWriteFeature CANONICAL_OUTPUT

Do we try to force so-called canonical output or not.

Ignored if you provide your own DumperOptions.

INDENT_ARRAYSback to summary
public static final YAMLWriteFeature INDENT_ARRAYS

Feature enabling of which adds indentation for array entry generation (default indentation being 2 spaces).

Default value is false for backwards compatibility

Ignored if you provide your own DumperOptions.

INDENT_ARRAYS_WITH_INDICATORback to summary
public static final YAMLWriteFeature INDENT_ARRAYS_WITH_INDICATOR

Feature enabling of which adds indentation with indicator for array entry generation (default indentation being 2 spaces).

Default value is false for backwards compatibility

Ignored if you provide your own DumperOptions.

LITERAL_BLOCK_STYLEback to summary
public static final YAMLWriteFeature LITERAL_BLOCK_STYLE

Whether for string containing newlines a literal block style should be used. This automatically enabled when MINIMIZE_QUOTES is set.

The content of such strings is limited to printable characters according to the rules of literal block style.

MINIMIZE_QUOTESback to summary
public static final YAMLWriteFeature MINIMIZE_QUOTES

Whether strings will be rendered without quotes (true) or with quotes (false, default).

Minimized quote usage makes for more human readable output; however, content is limited to printable characters according to the rules of literal block style.

SPLIT_LINESback to summary
public static final YAMLWriteFeature SPLIT_LINES

Options passed to SnakeYAML that determines whether longer textual content gets automatically split into multiple lines or not.

Feature is enabled by default to conform to SnakeYAML defaults.

Ignored if you provide your own DumperOptions.

USE_NATIVE_OBJECT_IDback to summary
public static final YAMLWriteFeature USE_NATIVE_OBJECT_ID

Whether to use YAML native Object Id construct for indicating type (true); or "generic" Object Id mechanism (false). Former works better for systems that are YAML-centric; latter may be better choice for interoperability, when converting between formats or accepting other formats.

USE_NATIVE_TYPE_IDback to summary
public static final YAMLWriteFeature USE_NATIVE_TYPE_ID

Whether to use YAML native Type Id construct for indicating type (true); or "generic" type property (false). Former works better for systems that are YAML-centric; latter may be better choice for interoperability, when converting between formats or accepting other formats.

WRITE_DOC_START_MARKERback to summary
public static final YAMLWriteFeature WRITE_DOC_START_MARKER

Whether we are to write an explicit document start marker ("---") or not.

Constructor Detail

YAMLWriteFeatureback to summary
private YAMLWriteFeature(boolean defaultState)

Method Detail

collectDefaultsback to summary
public static int collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

enabledByDefaultback to summary
public boolean enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Doc from tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

Annotations
@Override
enabledInback to summary
public boolean enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Doc from tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

Annotations
@Override
getMaskback to summary
public int getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Doc from tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

Annotations
@Override
valueOfback to summary
public static YAMLWriteFeature valueOf(String name)
valuesback to summary
public static YAMLWriteFeature[] values()