java.lang.Object | |
↳ | org.apache.xerces.util.XMLChar |
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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MASK_CONTENT | Content character mask. | |||||||||
int | MASK_NAME | Name character mask. | |||||||||
int | MASK_NAME_START | Name start character mask. | |||||||||
int | MASK_NCNAME | NCName character mask. | |||||||||
int | MASK_NCNAME_START | NCName start character mask. | |||||||||
int | MASK_PUBID | Pubid character mask. | |||||||||
int | MASK_SPACE | Space character mask. | |||||||||
int | MASK_VALID | Valid character mask. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the high surrogate of a supplemental character
| |||||||||||
Returns true if the specified character can be considered content.
| |||||||||||
Returns whether the given character is a high surrogate
| |||||||||||
Returns true if the specified character is invalid.
| |||||||||||
Returns whether the given character is a low surrogate
| |||||||||||
Returns true if the specified character can be considered markup.
| |||||||||||
Returns true if the specified character is a valid NCName
character as defined by production [5] in Namespaces in XML
recommendation.
| |||||||||||
Returns true if the specified character is a valid NCName start
character as defined by production [4] in Namespaces in XML
recommendation.
| |||||||||||
Returns true if the specified character is a valid name
character as defined by production [4] in the XML 1.0
specification.
| |||||||||||
Returns true if the specified character is a valid name start
character as defined by production [5] in the XML 1.0
specification.
| |||||||||||
Returns true if the specified character is a valid Pubid
character as defined by production [13] in the XML 1.0
specification.
| |||||||||||
Returns true if the specified character is a space character
as defined by production [3] in the XML 1.0 specification.
| |||||||||||
Returns true if the specified character is a supplemental character.
| |||||||||||
Returns true if the specified character is valid.
| |||||||||||
Returns true if the encoding name is a valid IANA encoding.
| |||||||||||
Returns true if the encoding name is a valid Java encoding.
| |||||||||||
Check to see if a string is a valid NCName according to [4]
from the XML Namespaces 1.0 Recommendation
| |||||||||||
Check to see if a string is a valid Name according to [5]
in the XML 1.0 Recommendation
| |||||||||||
Check to see if a string is a valid Nmtoken according to [7]
in the XML 1.0 Recommendation
| |||||||||||
Returns the low surrogate of a supplemental character
| |||||||||||
Returns true the supplemental character corresponding to the given
surrogates.
| |||||||||||
Trims space characters as defined by production [3] in
the XML 1.0 specification from both ends of the given string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Content character mask. Special characters are those that can be considered the start of markup, such as '<' and '&'. The various newline characters are considered special as well. All other valid XML characters can be considered content.
This is an optimization for the inner loop of character scanning.
Name character mask.
Name start character mask.
NCName character mask.
NCName start character mask.
Pubid character mask.
Space character mask.
Valid character mask.
Returns the high surrogate of a supplemental character
c | The supplemental character to "split". |
---|
Returns true if the specified character can be considered content.
c | The character to check. |
---|
Returns whether the given character is a high surrogate
c | The character to check. |
---|
Returns true if the specified character is invalid.
c | The character to check. |
---|
Returns whether the given character is a low surrogate
c | The character to check. |
---|
Returns true if the specified character can be considered markup. Markup characters include '<', '&', and '%'.
c | The character to check. |
---|
Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML recommendation.
c | The character to check. |
---|
Returns true if the specified character is a valid NCName start character as defined by production [4] in Namespaces in XML recommendation.
c | The character to check. |
---|
Returns true if the specified character is a valid name character as defined by production [4] in the XML 1.0 specification.
c | The character to check. |
---|
Returns true if the specified character is a valid name start character as defined by production [5] in the XML 1.0 specification.
c | The character to check. |
---|
Returns true if the specified character is a valid Pubid character as defined by production [13] in the XML 1.0 specification.
c | The character to check. |
---|
Returns true if the specified character is a space character as defined by production [3] in the XML 1.0 specification.
c | The character to check. |
---|
Returns true if the specified character is a supplemental character.
c | The character to check. |
---|
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.
c | The character to check. |
---|
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.
ianaEncoding | The IANA encoding name. |
---|
Returns true if the encoding name is a valid Java encoding. This method does not verify that there is a decoder available for this encoding, only that the characters are valid for an Java encoding name.
javaEncoding | The Java encoding name. |
---|
Check to see if a string is a valid NCName according to [4] from the XML Namespaces 1.0 Recommendation
ncName | string to check |
---|
Check to see if a string is a valid Name according to [5] in the XML 1.0 Recommendation
name | string to check |
---|
Check to see if a string is a valid Nmtoken according to [7] in the XML 1.0 Recommendation
nmtoken | string to check |
---|
Returns the low surrogate of a supplemental character
c | The supplemental character to "split". |
---|
Returns true the supplemental character corresponding to the given surrogates.
h | The high surrogate. |
---|---|
l | The low surrogate. |
Trims space characters as defined by production [3] in the XML 1.0 specification from both ends of the given string.
value | the string to be trimmed |
---|