public final class XMLChar extends 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.
| Modifier and Type | Field and Description |
|---|---|
static int |
MASK_NAME
Name character mask.
|
static int |
MASK_NAME_START
Name start character mask.
|
static int |
MASK_NCNAME
NCName character mask.
|
static int |
MASK_NCNAME_START
NCName start character mask.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isLowSurrogate(int c) |
static boolean |
isName(int c) |
static boolean |
isNameStart(int c) |
static boolean |
isNCName(int c) |
static boolean |
isNCNameStart(int c) |
static boolean |
isValidName(String name)
Check to see if a string is a valid Name according to [5] in the XML 1.0
Recommendation
|
static boolean |
isValidNCName(String ncName)
Check to see if a string is a valid NCName according to [4] from the XML
Namespaces 1.0 Recommendation
|
static int |
supplemental(char h,
char l) |
public static final int MASK_NAME_START
public static final int MASK_NAME
public static final int MASK_NCNAME_START
public static final int MASK_NCNAME
public static int supplemental(char h,
char l)
h - The high surrogate.l - The low surrogate.public static boolean isLowSurrogate(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 isNCNameStart(int c)
c - The character to check.public static boolean isNCName(int c)
c - The character to check.public static boolean isValidName(String name)
name - string to checkpublic static boolean isValidNCName(String ncName)
ncName - string to checkCopyright © 2024 HtmlUnit. All rights reserved.