Enum Class JavaEscaper.Option

java.lang.Object
java.lang.Enum<JavaEscaper.Option>
org.cthing.escapers.JavaEscaper.Option
All Implemented Interfaces:
Serializable, Comparable<JavaEscaper.Option>, Constable
Enclosing class:
JavaEscaper

public static enum JavaEscaper.Option extends Enum<JavaEscaper.Option>
Escaping options.
  • Enum Constant Details

    • ESCAPE_SPACE

      public static final JavaEscaper.Option 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

      public static final JavaEscaper.Option 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

      public static JavaEscaper.Option[] 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 JavaEscaper.Option 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