Enum Class StringEscapePolicy
- All Implemented Interfaces:
CharSequenceTranslatorFactory,Serializable,Comparable<StringEscapePolicy>,Constable
public enum StringEscapePolicy
extends Enum<StringEscapePolicy>
implements CharSequenceTranslatorFactory
StringEscapePolicy lists all acceptable JSON string escape policy of the
JsonFlattener.- Author:
- Wei-Ming Wu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEscapes all JSON special characters and Unicode.Escapes all JSON special characters and Unicode but slash('/').Escapes all JSON special characters but slash('/') and Unicode.Escapes all JSON special characters but Unicode.Deprecated.Escapes all JSON special characters but slash('/') and Unicode.Deprecated.for removal in 0.17.0 in favor ofALL_BUT_UNICODE -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.text.translate.CharSequenceTranslatorReturns aCharSequenceTranslatorstatic StringEscapePolicyReturns the enum constant of this class with the specified name.static StringEscapePolicy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORMAL
Deprecated.for removal in 0.17.0 in favor ofALL_BUT_UNICODEEscapes all JSON special characters but Unicode. -
ALL_UNICODES
Deprecated.for removal in 0.17.0 in favor ofALLEscapes all JSON special characters and Unicode. -
ALL
Escapes all JSON special characters and Unicode. -
ALL_BUT_SLASH
Escapes all JSON special characters and Unicode but slash('/'). -
ALL_BUT_UNICODE
Escapes all JSON special characters but Unicode. -
ALL_BUT_SLASH_AND_UNICODE
Escapes all JSON special characters but slash('/') and Unicode. -
DEFAULT
Escapes all JSON special characters but slash('/') and Unicode.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getCharSequenceTranslator
public org.apache.commons.text.translate.CharSequenceTranslator getCharSequenceTranslator()Description copied from interface:CharSequenceTranslatorFactoryReturns aCharSequenceTranslator- Specified by:
getCharSequenceTranslatorin interfaceCharSequenceTranslatorFactory- Returns:
CharSequenceTranslator
-
ALL