Enum Class StringEscapePolicy

java.lang.Object
java.lang.Enum<StringEscapePolicy>
com.github.wnameless.json.flattener.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
  • Enum Constant Details

    • NORMAL

      @Deprecated public static final StringEscapePolicy NORMAL
      Deprecated.
      for removal in 0.17.0 in favor of ALL_BUT_UNICODE
      Escapes all JSON special characters but Unicode.
    • ALL_UNICODES

      @Deprecated public static final StringEscapePolicy ALL_UNICODES
      Deprecated.
      for removal in 0.17.0 in favor of ALL
      Escapes all JSON special characters and Unicode.
    • ALL

      public static final StringEscapePolicy ALL
      Escapes all JSON special characters and Unicode.
    • ALL_BUT_SLASH

      public static final StringEscapePolicy ALL_BUT_SLASH
      Escapes all JSON special characters and Unicode but slash('/').
    • ALL_BUT_UNICODE

      public static final StringEscapePolicy ALL_BUT_UNICODE
      Escapes all JSON special characters but Unicode.
    • ALL_BUT_SLASH_AND_UNICODE

      public static final StringEscapePolicy ALL_BUT_SLASH_AND_UNICODE
      Escapes all JSON special characters but slash('/') and Unicode.
    • DEFAULT

      public static final StringEscapePolicy DEFAULT
      Escapes all JSON special characters but slash('/') and Unicode.
  • Method Details

    • values

      public static StringEscapePolicy[] 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

      public static StringEscapePolicy valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCharSequenceTranslator

      public org.apache.commons.text.translate.CharSequenceTranslator getCharSequenceTranslator()
      Description copied from interface: CharSequenceTranslatorFactory
      Returns a CharSequenceTranslator
      Specified by:
      getCharSequenceTranslator in interface CharSequenceTranslatorFactory
      Returns:
      CharSequenceTranslator