StringUtil.JsStringEncCompatibility (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template.utility, class: StringUtil, enum: JsStringEncCompatibility

Package freemarker.template.utility

# 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>
Used as the argument of `StringUtil.jsStringEnc(String, JsStringEncCompatibility, JsStringEncQuotation)`.

Since:
  2.3.32

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `JAVA_SCRIPT`
  Output is expected to be used in JavaScript, not in JSON.
  `JAVA_SCRIPT_OR_JSON`
  Output is expected to be used both in JSON and JavaScript.
  `JSON`
  Output is expected to be used in JSON, not in JavaScript.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static StringUtil.JsStringEncCompatibility`
  `valueOf​(String name)`
  Returns the enum constant of this class with the specified name.
  `static StringUtil.JsStringEncCompatibility[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## 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