Enum Class StringUtil.JsStringEncCompatibility

java.lang.Object
java.lang.Enum<StringUtil.JsStringEncCompatibility>
freemarker.template.utility.StringUtil.JsStringEncCompatibility
All Implemented Interfaces:
Serializable, Comparable<StringUtil.JsStringEncCompatibility>, Constable
Enclosing class:
StringUtil

public static enum StringUtil.JsStringEncCompatibility extends Enum<StringUtil.JsStringEncCompatibility>
Since:
2.3.32
  • Enum Constant Details

    • JAVA_SCRIPT

      public static final StringUtil.JsStringEncCompatibility JAVA_SCRIPT
      Output is expected to be used in JavaScript, not in JSON.
    • JSON

      public static final StringUtil.JsStringEncCompatibility JSON
      Output is expected to be used in JSON, not in JavaScript. While JSON is compatible with JavaScript, in this mode we don't care about escaping apostrophe, as it's not special in JSON.
    • JAVA_SCRIPT_OR_JSON

      public static final StringUtil.JsStringEncCompatibility JAVA_SCRIPT_OR_JSON
      Output is expected to be used both in JSON and JavaScript.
  • Method Details

    • values

      public static StringUtil.JsStringEncCompatibility[] 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 StringUtil.JsStringEncCompatibility 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