XMLChar (Apache Tomcat 8.5.53 API Documentation)

org.apache.jasper.xmlparser

## Class XMLChar

- java.lang.Object
- - org.apache.jasper.xmlparser.XMLChar

- Deprecated.
  Will be removed in Tomcat 9.0.x onwards

      @Deprecated
      public class XMLChar
      extends Object

  This class defines the basic XML character properties. The data in this class can be used to verify that a character is a valid XML character or if the character is a space, name start, or name character.

  A series of convenience methods are supplied to ease the burden of the developer. Because inlining the checks can improve per character performance, the tables of character properties are public. Using the character as an index into the `CHARS` array and applying the appropriate mask flag (e.g. `MASK_VALID`), yields the same results as calling the convenience methods. There is one exception: check the comments for the `isValid` method for details.

  Author:
    Glenn Marcy, IBM, Andy Clark, IBM, Eric Ye, IBM, Arnaud Le Hors, IBM, Michael Glavassevich, IBM, Rahul Srivastava, Sun Microsystems Inc.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLChar()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `isContent(int c)` Deprecated. Returns true if the specified character can be considered content.
    `static boolean` | `isHighSurrogate(int c)` Deprecated. Returns whether the given character is a high surrogate
    `static boolean` | `isInvalid(int c)` Deprecated. Returns true if the specified character is invalid.
    `static boolean` | `isLowSurrogate(int c)` Deprecated. Returns whether the given character is a low surrogate
    `static boolean` | `isName(int c)` Deprecated. Returns true if the specified character is a valid name character as defined by production [4] in the XML 1.0 specification.
    `static boolean` | `isNameStart(int c)` Deprecated. Returns true if the specified character is a valid name start character as defined by production [5] in the XML 1.0 specification.
    `static boolean` | `isSpace(int c)` Deprecated. Returns true if the specified character is a space character as defined by production [3] in the XML 1.0 specification.
    `static boolean` | `isValid(int c)` Deprecated. Returns true if the specified character is valid.
    `static boolean` | `isValidIANAEncoding(String ianaEncoding)` Deprecated. Returns true if the encoding name is a valid IANA encoding.
    `static int` | `supplemental(char h, char l)` Deprecated. Returns the supplemental character corresponding to the given surrogates.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XMLChar

          public XMLChar()

      Deprecated.

  - ### Method Detail

    - #### supplemental

          public static int supplemental(char h,
                         char l)

      Deprecated.
      Returns the supplemental character corresponding to the given surrogates.
      Parameters:
        `h` - The high surrogate.
        `l` - The low surrogate.
      Returns:
        the supplemental character

    - #### isHighSurrogate

          public static boolean isHighSurrogate(int c)

      Deprecated.
      Returns whether the given character is a high surrogate
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is a surrogate

    - #### isLowSurrogate

          public static boolean isLowSurrogate(int c)

      Deprecated.
      Returns whether the given character is a low surrogate
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is a surrogate

    - #### isValid

          public static boolean isValid(int c)

      Deprecated.
      Returns true if the specified character is valid. This method also checks the surrogate character range from 0x10000 to 0x10FFFF.

      If the program chooses to apply the mask directly to the `CHARS` array, then they are responsible for checking the surrogate character range.

      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is valid

    - #### isInvalid

          public static boolean isInvalid(int c)

      Deprecated.
      Returns true if the specified character is invalid.
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is invalid

    - #### isContent

          public static boolean isContent(int c)

      Deprecated.
      Returns true if the specified character can be considered content.
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is content

    - #### isSpace

          public static boolean isSpace(int c)

      Deprecated.
      Returns true if the specified character is a space character as defined by production [3] in the XML 1.0 specification.
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is space

    - #### isNameStart

          public static boolean isNameStart(int c)

      Deprecated.
      Returns true if the specified character is a valid name start character as defined by production [5] in the XML 1.0 specification.
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is a valid start name

    - #### isName

          public static boolean isName(int c)

      Deprecated.
      Returns true if the specified character is a valid name character as defined by production [4] in the XML 1.0 specification.
      Parameters:
        `c` - The character to check.
      Returns:
        `true` if the character is valid in a name

    - #### isValidIANAEncoding

          public static boolean isValidIANAEncoding(String ianaEncoding)

      Deprecated.
      Returns true if the encoding name is a valid IANA encoding. This method does not verify that there is a decoder available for this encoding, only that the characters are valid for an IANA encoding name.
      Parameters:
        `ianaEncoding` - The IANA encoding name.
      Returns:
        `true` if the character is valid encoding

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.