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 ConstantDescriptionOutput is expected to be used in JavaScript, not in JSON.Output is expected to be used both in JSON and JavaScript.Output is expected to be used in JSON, not in JavaScript. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.
-
Enum Constant Details
-
JAVA_SCRIPT
Output is expected to be used in JavaScript, not in JSON. -
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
Output is expected to be used both in JSON and JavaScript.
-
-
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
-