com.ximpleware.extended.parser
Class XMLChar

java.lang.Object
  extended by com.ximpleware.extended.parser.XMLChar

public class XMLChar
extends Object

XimpleWare's XMLChar implementation. Creation date: (2/9/04 6:27:46 PM)


Field Summary
static int XML_CONTENT
          Content character mask.
static int XML_NAME
          Name character mask.
static int XML_NAME_START
          Name start character mask.
static int XML_NCNAME
          NCName character mask.
static int XML_NCNAME_START
          NCName start character mask.
static int XML_PUBID
          Pubid character mask.
static int XML_SPACE
          Space character mask.
static int XML_VALID
          Valid character mask.
 
Constructor Summary
XMLChar()
           
 
Method Summary
static char highSurrogate(int c)
          Returns the high surrogate from a Unicode scalar value
static boolean isContentChar(int c)
          Returns true if the specified character can be considered XML content.
static boolean isHighSurrogate(int c)
          Returns whether the given Unicode scalar value is a high surrogate
static boolean isInvalidChar(int c)
          Returns true if the specified character is invalid.
static boolean isLowSurrogate(int c)
          Returns whether the given Unicode scalar value is a low surrogate
static boolean isMarkupChar(int c)
          Returns true if the specified character can be considered markup.
static boolean isNameChar(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 isNameStartChar(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 isNCNameChar(int c)
          Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML recommendation.
static boolean isNCNameStartChar(int c)
          Returns true if the specified character is a valid NCName start character as defined by production [4] in Namespaces in XML recommendation.
static boolean isNmtoken(String nmToken)
           
static boolean isPubidChar(int c)
          Returns true if the specified character is a valid Pubid character as defined by production [13] in the XML 1.0 specification.
static boolean isSpaceChar(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 isSupplementalChar(int c)
          Returns true if the specified character is a supplemental character.
static boolean isValidChar(int c)
          Returns true if the specified character is valid.
static char lowSurrogate(int c)
          Returns the low surrogate from a Unicode scalar value
static int scalarValueSurrogate(char hi, char lo)
          Returns Unicode scalar value corresponding to the given surrogates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_VALID

public static final int XML_VALID
Valid character mask.

See Also:
Constant Field Values

XML_SPACE

public static final int XML_SPACE
Space character mask.

See Also:
Constant Field Values

XML_NAME_START

public static final int XML_NAME_START
Name start character mask.

See Also:
Constant Field Values

XML_NAME

public static final int XML_NAME
Name character mask.

See Also:
Constant Field Values

XML_PUBID

public static final int XML_PUBID
Pubid character mask.

See Also:
Constant Field Values

XML_CONTENT

public static final int XML_CONTENT
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.

See Also:
Constant Field Values

XML_NCNAME_START

public static final int XML_NCNAME_START
NCName start character mask.

See Also:
Constant Field Values

XML_NCNAME

public static final int XML_NCNAME
NCName character mask.

See Also:
Constant Field Values
Constructor Detail

XMLChar

public XMLChar()
Method Detail

highSurrogate

public static char highSurrogate(int c)
Returns the high surrogate from a Unicode scalar value

Parameters:
c - The Unicode scalar value to "split".

isContentChar

public static boolean isContentChar(int c)
Returns true if the specified character can be considered XML content.

Parameters:
c - The character to check.

isHighSurrogate

public static boolean isHighSurrogate(int c)
Returns whether the given Unicode scalar value is a high surrogate

Parameters:
c - The character to check.

isInvalidChar

public static boolean isInvalidChar(int c)
Returns true if the specified character is invalid.

Parameters:
c - The character to check.

isLowSurrogate

public static boolean isLowSurrogate(int c)
Returns whether the given Unicode scalar value is a low surrogate

Parameters:
c - The character to check.

isMarkupChar

public static boolean isMarkupChar(int c)
Returns true if the specified character can be considered markup. Markup characters include '<', '&', and '%'.

Parameters:
c - The character to check.

isNameChar

public static boolean isNameChar(int c)
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.

isNameStartChar

public static boolean isNameStartChar(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.

Parameters:
c - The character to check.

isNCNameChar

public static boolean isNCNameChar(int c)
Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML recommendation.

Parameters:
c - The character to check.

isNCNameStartChar

public static boolean isNCNameStartChar(int c)
Returns true if the specified character is a valid NCName start character as defined by production [4] in Namespaces in XML recommendation.

Parameters:
c - The character to check.

isNmtoken

public static boolean isNmtoken(String nmToken)

isPubidChar

public static boolean isPubidChar(int c)
Returns true if the specified character is a valid Pubid character as defined by production [13] in the XML 1.0 specification.

Parameters:
c - The character to check.

isSpaceChar

public static boolean isSpaceChar(int c)
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.

isSupplementalChar

public static boolean isSupplementalChar(int c)
Returns true if the specified character is a supplemental character.

Parameters:
c - The character to check.

isValidChar

public static boolean isValidChar(int c)
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 UNI_CHARS array, then they are responsible for checking the surrogate character range.

Parameters:
c - The character to check.

lowSurrogate

public static char lowSurrogate(int c)
Returns the low surrogate from a Unicode scalar value

Parameters:
c - The Unicode scalar value to "split".

scalarValueSurrogate

public static int scalarValueSurrogate(char hi,
                                       char lo)
Returns Unicode scalar value corresponding to the given surrogates.

Parameters:
hi - The high surrogate.
lo - The low surrogate.


Copyright © 2013. All Rights Reserved.