Enum Class HtmlEscaper.Option

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

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

    • USE_DECIMAL

      public static final HtmlEscaper.Option USE_DECIMAL
      Use decimal for numerical character entities (i.e. &#DDDD;). By default, this library uses hexadecimal (i.e. &#xHHH;) for numerical character entities.
    • ESCAPE_NON_ASCII

      public static final HtmlEscaper.Option ESCAPE_NON_ASCII
      Escape characters above the ASCII range (i.e. ch > 0x7F). By default, only ASCII control characters and markup-significant ASCII characters are escaped. Specifying this option causes all ISO Latin-1, Unicode BMP and surrogate pair characters to be escaped.
    • USE_ISO_LATIN_1_ENTITIES

      public static final HtmlEscaper.Option USE_ISO_LATIN_1_ENTITIES
      Replaces characters in the ISO Latin-1 range (0x80 - 0xFF) with their corresponding named entity references. For example, the pound character (0xA3) is replaced with the pound entity reference (&pound;). See Section 24.2 of the HTML 4 specification for the complete list of ISO Latin-1 character entities.

      Note that markup-significant HTML escapes are always applied (e.g. &lt;, &quot;) regardless of the use of this option.

    • USE_HTML4_EXTENDED_ENTITIES

      public static final HtmlEscaper.Option USE_HTML4_EXTENDED_ENTITIES
      Replaces characters in the HTML 4 extended range (0x100 - 0xFFFF) with their corresponding named entity references where they exist. For example, the pi character (0x3A0) is replaced with the pi entity reference (&pi;). See Section 24.3 and Section 24.4 of the HTML 4 specification for the complete list of these character entities.

      Note that markup-significant HTML escapes are always applied (e.g. &lt;, &quot;) regardless of the use of this option.

  • Method Details

    • values

      public static HtmlEscaper.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 HtmlEscaper.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