Enum YAMLGenerator.Feature
- All Implemented Interfaces:
com.fasterxml.jackson.core.FormatFeature
,com.fasterxml.jackson.core.util.JacksonFeature
,Serializable
,Comparable<YAMLGenerator.Feature>
,java.lang.constant.Constable
- Enclosing class:
YAMLGenerator
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionOption passed to SnakeYAML to allows writing key longer that 128 characters (up to 1024 characters).Whether numbers stored as strings will be rendered with quotes (true) or without quotes (false, default) when MINIMIZE_QUOTES is enabled.Do we try to force so-called canonical output or not.Feature enabling of which adds indentation for array entry generation (default indentation being 2 spaces).Feature enabling of which adds indentation with indicator for array entry generation (default indentation being 2 spaces).Whether for string containing newlines a literal block style should be used.Whether strings will be rendered without quotes (true) or with quotes (false, default).Options passed to SnakeYAML that determines whether longer textual content gets automatically split into multiple lines or not.Whether to use YAML native Object Id construct for indicating type (true); or "generic" Object Id mechanism (false).Whether to use YAML native Type Id construct for indicating type (true); or "generic" type property (false).Option passed to SnakeYAML that determines if the line breaks used for serialization should be same as what the default is for current platform.Whether we are to write an explicit document start marker ("---") or not. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Method that calculates bit set (flags) of all features that are enabled by default.boolean
boolean
enabledIn
(int flags) int
getMask()
static YAMLGenerator.Feature
Returns the enum constant of this type with the specified name.static YAMLGenerator.Feature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
WRITE_DOC_START_MARKER
Whether we are to write an explicit document start marker ("---") or not.- Since:
- 2.3
-
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.- Since:
- 2.5
-
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.- Since:
- 2.5
-
CANONICAL_OUTPUT
Do we try to force so-called canonical output or not.Ignored if you provide your own
DumperOptions
. -
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 as well as backwards compatibility with 2.5 and earlier versions.
Ignored if you provide your own
DumperOptions
.- Since:
- 2.6
-
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.
- Since:
- 2.7
-
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.
- Since:
- 2.8.2
-
LITERAL_BLOCK_STYLE
Whether for string containing newlines a literal block style should be used. This automatically enabled whenMINIMIZE_QUOTES
is set.The content of such strings is limited to printable characters according to the rules of literal block style.
- Since:
- 2.9
-
INDENT_ARRAYS
Feature enabling of which adds indentation for array entry generation (default indentation being 2 spaces).Default value is
false
for backwards compatibilityIgnored if you provide your own
DumperOptions
.- Since:
- 2.9
-
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 compatibilityIgnored if you provide your own
DumperOptions
.- Since:
- 2.12
-
USE_PLATFORM_LINE_BREAKS
Option passed to SnakeYAML that determines if the line breaks used for serialization should be same as what the default is for current platform. If disabled, Unix linefeed (\n
) will be used.Default value is
false
for backwards compatibilityIgnored if you provide your own
DumperOptions
.- Since:
- 2.9.6
-
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.Default value is
false
for backwards-compatibility (same as behavior before this feature was added).Ignored if you provide your own
DumperOptions
.- Since:
- 2.14
-
-
Field Details
-
_defaultState
protected final boolean _defaultState -
_mask
protected final int _mask
-
-
Constructor Details
-
Feature
private Feature(boolean defaultState)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
collectDefaults
public static int collectDefaults()Method that calculates bit set (flags) of all features that are enabled by default. -
enabledByDefault
public boolean enabledByDefault()- Specified by:
enabledByDefault
in interfacecom.fasterxml.jackson.core.FormatFeature
- Specified by:
enabledByDefault
in interfacecom.fasterxml.jackson.core.util.JacksonFeature
-
enabledIn
public boolean enabledIn(int flags) - Specified by:
enabledIn
in interfacecom.fasterxml.jackson.core.FormatFeature
- Specified by:
enabledIn
in interfacecom.fasterxml.jackson.core.util.JacksonFeature
-
getMask
public int getMask()- Specified by:
getMask
in interfacecom.fasterxml.jackson.core.FormatFeature
- Specified by:
getMask
in interfacecom.fasterxml.jackson.core.util.JacksonFeature
-