de.speexx.xml
Class XmlCharacterValidator

java.lang.Object
  extended by de.speexx.xml.XmlCharacterValidator

public final class XmlCharacterValidator
extends Object

Utility class for checking names and characters for use in XML, the serialization format.

Don't refere to this class outside of this package cause it maybe move later to the de.speexx.xml.sax.helpers package.

© Copyright 2005 Sascha Kohlmann under the terms of the GNU LGPL

Author:
Sascha Kohlmann

Method Summary
static boolean isBaseChar(char c)
          Checks if the given character is in the scope of the XML BaseChar part.
static boolean isChar(char c)
          Checks if the given character is in the scope of the XML Char part.
static boolean isCombiningChar(char c)
          Checks if the given character is in the scope of the XML CombiningChar part.
static boolean isDigit(char c)
          Checks if the given character is in the scope of the XML Digit part.
static boolean isExtender(char c)
          Checks if the given character is in the scope of the XML Extender part.
static boolean isIdeographic(char c)
          Checks if the given character is in the scope of the XML Ideographic part.
static boolean isLetter(char c)
          Checks if the given character is in the scope of the XML Letter part.
static boolean isName(CharSequence name)
          Checks if the given String is in the scope of the XML Name part.
static boolean isNameChar(char c)
          Checks if the given character is in the scope of the XML NameChar part.
static boolean isNcName(CharSequence name)
          Checks if the given String is in the scope of the XML NCName part.
static boolean isNcNameChar(char c)
          Checks if the given character is in the scope of the XML namespace NCNameChar part.
static boolean isNmToken(CharSequence name)
          Checks if the given String is in the scope of the XML NmToken part.
static boolean isS(char c)
          Checks if the given character is in the scope of the XML space (S) part.
static boolean isSpace(char c)
          Checks if the given character is in the scope of the XML space (S) part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isBaseChar

public static boolean isBaseChar(char c)
Checks if the given character is in the scope of the XML BaseChar part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML BaseChar definition. Otherwise false.

isCombiningChar

public static boolean isCombiningChar(char c)
Checks if the given character is in the scope of the XML CombiningChar part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML CombiningChar definition. Otherwise false.

isDigit

public static boolean isDigit(char c)
Checks if the given character is in the scope of the XML Digit part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML Digit definition. Otherwise false.

isExtender

public static boolean isExtender(char c)
Checks if the given character is in the scope of the XML Extender part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML Extender definition. Otherwise false.

isIdeographic

public static boolean isIdeographic(char c)
Checks if the given character is in the scope of the XML Ideographic part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML Ideographic definition. Otherwise false.

isLetter

public static boolean isLetter(char c)
Checks if the given character is in the scope of the XML Letter part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML Letter definition. Otherwise false.

isNameChar

public static boolean isNameChar(char c)
Checks if the given character is in the scope of the XML NameChar part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML NameChar definition. Otherwise false.

isNcNameChar

public static boolean isNcNameChar(char c)
Checks if the given character is in the scope of the XML namespace NCNameChar part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML namespace NCNameChar definition. Otherwise false.

isNcName

public static boolean isNcName(CharSequence name)
Checks if the given String is in the scope of the XML NCName part.

Parameters:
name - the String to test.
Returns:
true if the String is part of the XML NCName definition. Otherwise false.

isName

public static boolean isName(CharSequence name)
Checks if the given String is in the scope of the XML Name part.

Parameters:
name - the String to test.
Returns:
true if the String is part of the XML Name definition. Otherwise false.

isNmToken

public static boolean isNmToken(CharSequence name)
Checks if the given String is in the scope of the XML NmToken part.

Parameters:
name - the String to test.
Returns:
true if the String is part of the XML NmToken definition. Otherwise false.

isS

public static boolean isS(char c)
Checks if the given character is in the scope of the XML space (S) part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML space (S) definition. Otherwise false.

isSpace

public static boolean isSpace(char c)
Checks if the given character is in the scope of the XML space (S) part.

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML space (S) definition. Otherwise false.

isChar

public static boolean isChar(char c)
Checks if the given character is in the scope of the XML Char part.

Note: At this time of writing the tests for characters bigger then 0xFFFd is not possible cause a Java char is only definied with 16 Bit. This may work with the JDK 1.5 .

Parameters:
c - the character to test.
Returns:
true if the character is part of the XML Char definition. Otherwise false.


Copyright © 2000-2006 SpeexX. All Rights Reserved.