com.fasterxml.jackson.dataformat.yaml.YAMLGenerator
to check whether property names and String values need to be quoted or not.
Also contains default logic implementation; may be sub-classed to provide
alternate implementation.
| Modifier and Type | Class and Description |
|---|---|
| public static class | StringQuotingChecker.
Default |
| Modifier and Type | Field and Description |
|---|---|
| private static final Set | RESERVED_KEYWORDS
As per YAML null and boolean type specs, better retain quoting for some keys (property names) and values. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | Returns: true if given value is a Boolean or Null representation
(as per YAML 1.1 specification) or empty StringString to check value)Helper method that sub-classes may use to see if given String value is one of: |
| protected boolean | looksLikeYAMLNumber(String name)
Helper method that sub-classes may use to see if given String value looks like a YAML 1.1 numeric value and would likely be considered a number when parsing unless quoting is used. |
| protected boolean | |
| public abstract boolean | needToQuoteName(String name)
Method called by
|
| public abstract boolean | needToQuoteValue(String value)
Method called by
|
| protected boolean | |
| protected boolean | valueHasQuotableChar(String inputStr)
As per YAML Plain Styleunquoted strings are restricted to a reduced charset and must be quoted in case they contain one of the following characters or character combinations. |
| RESERVED_KEYWORDS | back to summary |
|---|---|
| private static final Set<String> RESERVED_KEYWORDS As per YAML null and boolean type specs, better retain quoting for some keys (property names) and values. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| StringQuotingChecker | back to summary |
|---|---|
| public StringQuotingChecker() | |
| _isReservedKeyword | back to summary |
|---|---|
| protected boolean _isReservedKeyword(int firstChar, String name) | |
| _looksLikeYAMLNumber | back to summary |
|---|---|
| protected boolean _looksLikeYAMLNumber(int firstChar, String name) | |
| followedOnlyByBlank | back to summary |
|---|---|
| protected boolean followedOnlyByBlank(String inputStr, int offset) | |
| isBlank | back to summary |
|---|---|
| protected boolean isBlank(char value) | |
| isReservedKeyword | back to summary |
|---|---|
| protected boolean isReservedKeyword(String value) Helper method that sub-classes may use to see if given String value is one of: | |
| looksLikeYAMLNumber | back to summary |
|---|---|
| protected boolean looksLikeYAMLNumber(String name) Helper method that sub-classes may use to see if given String value looks like a YAML 1.1 numeric value and would likely be considered a number when parsing unless quoting is used. | |
| nameHasQuotableChar | back to summary |
|---|---|
| protected boolean nameHasQuotableChar(String inputStr) Looks like we may get names with "funny characters" so.
| |
| needToQuoteName | back to summary |
|---|---|
| public abstract boolean needToQuoteName(String name) Method called by
| |
| needToQuoteValue | back to summary |
|---|---|
| public abstract boolean needToQuoteValue(String value) Method called by
| |
| precededOnlyByBlank | back to summary |
|---|---|
| protected boolean precededOnlyByBlank(String inputStr, int offset) | |
| valueHasQuotableChar | back to summary |
|---|---|
| protected boolean valueHasQuotableChar(String inputStr) As per YAML Plain Styleunquoted strings are restricted to a reduced charset and must be quoted in case they contain one of the following characters or character combinations. | |
StringQuotingChecker implementation used unless
custom implementation registered.
| Modifier and Type | Field and Description |
|---|---|
| private static final StringQuotingChecker. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static StringQuotingChecker. | |
| public boolean | needToQuoteName(String name)
Implements abstract com. Default implementation will call
|
| public boolean | needToQuoteValue(String value)
Implements abstract com. Default implementation will call
|
| INSTANCE | back to summary |
|---|---|
| private static final StringQuotingChecker. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| Default | back to summary |
|---|---|
| public Default() | |
| instance | back to summary |
|---|---|
| public static StringQuotingChecker. | |
| needToQuoteName | back to summary |
|---|---|
| public boolean needToQuoteName(String name) Implements abstract com. Default implementation will call
| |
| needToQuoteValue | back to summary |
|---|---|
| public boolean needToQuoteValue(String value) Implements abstract com. Default implementation will call
| |