Package org.cthing.escapers
Enum Class JavaEscaper.Option
- All Implemented Interfaces:
Serializable,Comparable<JavaEscaper.Option>,Constable
- Enclosing class:
- JavaEscaper
Escaping options.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEscape characters above the ASCII range (i.e.Escape space characters. -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaEscaper.OptionReturns the enum constant of this class with the specified name.static JavaEscaper.Option[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
ESCAPE_SPACE
Escape space characters. With the introduction of text blocks in Java 15, an escape sequence ('\s') was created to indicate a space character (0x20). If this option is specified, space characters are written using the '\s' escape sequence. Without this option, space characters are written unescaped. When targeting Java 15 or newer, this option can be specified if the escaped string will be used in a text block. When targeting Java 14 or older, this option must not be specified. -
ESCAPE_NON_ASCII
Escape characters above the ASCII range (i.e. ch > 0x7F). By default, only ASCII control characters and certain ASCII printable characters are escaped. Specifying this option causes all ISO Latin-1, Unicode BMP and surrogate pair characters to be escaped (i.e. one or two \uXXXX).
-
-
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
-