Class NumericEscaper


public class NumericEscaper extends CodePointTranslator
Translates codepoints to their XML numeric entity escaped value.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • NumericEscaper

      public NumericEscaper()

      Constructs a NumericEscaper for all characters.

  • Method Details

    • below

      public static NumericEscaper below(int codepoint)

      Constructs a NumericEscaper below the specified value (exclusive).

      Parameters:
      codepoint - below which to escape
      Returns:
      the newly created NumericEscaper instance
    • above

      public static NumericEscaper above(int codepoint)

      Constructs a NumericEscaper above the specified value (exclusive).

      Parameters:
      codepoint - above which to escape
      Returns:
      the newly created NumericEscaper instance
    • between

      public static NumericEscaper between(int codepointLow, int codepointHigh)

      Constructs a NumericEscaper between the specified values (inclusive).

      Parameters:
      codepointLow - above which to escape
      codepointHigh - below which to escape
      Returns:
      the newly created NumericEscaper instance
    • outsideOf

      public static NumericEscaper outsideOf(int codepointLow, int codepointHigh)

      Constructs a NumericEscaper outside of the specified values (exclusive).

      Parameters:
      codepointLow - below which to escape
      codepointHigh - above which to escape
      Returns:
      the newly created NumericEscaper instance
    • translate

      public boolean translate(int codepoint, Writer out) throws IOException
      Specified by:
      translate in class CodePointTranslator
      Throws:
      IOException