Top Description Constructors Methods
com.sun.xml.dtdparser

public Class XmlChars

extends Object
Class Inheritance

Methods in this class are used to determine whether characters may appear in certain roles in XML documents. Such methods are used both to parse and to create such documents.
Author
David Brownell

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the argument is valid in XML documents
isChar
(int
The 32-bit UCS-4 character being tested.
ucs4char
)

Returns true if the argument, a UCS-4 character code, is valid in XML documents.

private static boolean
private static boolean
isExtender(char c)

public static boolean

Returns:

true if the character is an XML "letter"
isLetter
(char
character to test
c
)

Returns true if the character is an XML "letter".

private static boolean
isLetter2(char c)

public static boolean

Returns:

true if the character is allowed to be a non-initial character
isNameChar
(char
character to test
c
)

Returns true if the character is allowed to be a non-initial character in names according to the XML recommendation.

public static boolean

Returns:

true if the character is allowed to be a non-initial character
isNCNameChar
(char
character to test
c
)

Returns true if the character is allowed to be a non-initial character in unscoped names according to the rules of the XML Namespaces proposed recommendation.

public static boolean

Returns:

true if the character is allowed
isSpace
(char
character to test
c
)

Returns true if the character is allowed where XML supports whitespace characters, false otherwise.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XmlCharsback to summary
private XmlChars()

Method Detail

isCharback to summary
public static boolean isChar(int ucs4char)

Returns true if the argument, a UCS-4 character code, is valid in XML documents. Unicode characters fit into the low sixteen bits of a UCS-4 character, and pairs of Unicode surrogate characters can be combined to encode UCS-4 characters in documents containing only Unicode. (The char datatype in the Java Programming Language represents Unicode characters, including unpaired surrogates.)

In XML, UCS-4 characters can also be encoded by the use of character references such as �, which happens to refer to a character that is disallowed in XML documents. UCS-4 characters allowed in XML documents can be expressed with one or two Unicode characters.

Parameters
ucs4char:int

The 32-bit UCS-4 character being tested.

Returns:boolean

true if the argument is valid in XML documents

isCompatibilityCharback to summary
private static boolean isCompatibilityChar(char c)
isExtenderback to summary
private static boolean isExtender(char c)
isLetterback to summary
public static boolean isLetter(char c)

Returns true if the character is an XML "letter". XML Names must start with Letters or a few other characters, but other characters in names must only satisfy the isNameChar predicate.

Parameters
c:char

character to test

Returns:boolean

true if the character is an XML "letter"

See Also
isNameChar(char), isNCNameChar(char)
isLetter2back to summary
private static boolean isLetter2(char c)
isNameCharback to summary
public static boolean isNameChar(char c)

Returns true if the character is allowed to be a non-initial character in names according to the XML recommendation.

Parameters
c:char

character to test

Returns:boolean

true if the character is allowed to be a non-initial character

See Also
isNCNameChar(char), isLetter(char)
isNCNameCharback to summary
public static boolean isNCNameChar(char c)

Returns true if the character is allowed to be a non-initial character in unscoped names according to the rules of the XML Namespaces proposed recommendation. Except for precluding the colon (used to separate names from their scopes) these characters are just as allowed by the XML recommendation.

Parameters
c:char

character to test

Returns:boolean

true if the character is allowed to be a non-initial character

See Also
isNameChar(char), isLetter(char)
isSpaceback to summary
public static boolean isSpace(char c)

Returns true if the character is allowed where XML supports whitespace characters, false otherwise.

Parameters
c:char

character to test

Returns:boolean

true if the character is allowed