public class XMLChar
extends java.lang.Object
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.
Constructor and Description |
---|
XMLChar() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isContent(int c)
Returns true if the specified character can be considered content.
|
static boolean |
isHighSurrogate(int c)
Returns whether the given character is a high surrogate
|
static boolean |
isInvalid(int c)
Returns true if the specified character is invalid.
|
static boolean |
isLowSurrogate(int c)
Returns whether the given character is a low surrogate
|
static boolean |
isName(int c)
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)
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)
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)
Returns true if the specified character is valid.
|
static boolean |
isValidIANAEncoding(java.lang.String ianaEncoding)
Returns true if the encoding name is a valid IANA encoding.
|
static int |
supplemental(char h,
char l)
Returns true the supplemental character corresponding to the given
surrogates.
|
public static int supplemental(char h, char l)
h
- The high surrogate.l
- The low surrogate.public static boolean isHighSurrogate(int c)
c
- The character to check.public static boolean isLowSurrogate(int c)
c
- The character to check.public static boolean isValid(int c)
If the program chooses to apply the mask directly to the
CHARS
array, then they are responsible for checking
the surrogate character range.
c
- The character to check.public static boolean isInvalid(int c)
c
- The character to check.public static boolean isContent(int c)
c
- The character to check.public static boolean isSpace(int c)
c
- The character to check.public static boolean isNameStart(int c)
c
- The character to check.public static boolean isName(int c)
c
- The character to check.public static boolean isValidIANAEncoding(java.lang.String ianaEncoding)
ianaEncoding
- The IANA encoding name.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.