org.znerd.xmlenc
Class XMLChecker

java.lang.Object
  extended byorg.znerd.xmlenc.XMLChecker

public final class XMLChecker
extends Object

Utility class that provides XML checking functionality.

Since:
xmlenc 0.41
Version:
$Revision: 1.9 $ $Date: 2004/01/15 21:53:03 $
Author:
Ernst de Haan (znerd@FreeBSD.org)

Method Summary
static void checkName(char[] ch, int start, int length)
          Checks if the specified part of a character array matches the Name production.
static void checkName(String name)
          Checks if the specified string matches the Name production.
static void checkS(char[] ch, int start, int length)
          Checks if the specified part of a character array matches the S (white space) production.
static void checkS(String s)
          Checks if the specified string matches the S (white space) production.
static boolean isName(String name)
          Determines if the specified string matches the Name production.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkS

public static final void checkS(String s)
                         throws NullPointerException
Checks if the specified string matches the S (white space) production.

See: Definition of S.

Parameters:
s - the character string to check, cannot be null.
Throws:
NullPointerException - if s == null.
InvalidXMLException - if the specified character string does not match the S production.

checkS

public static final void checkS(char[] ch,
                                int start,
                                int length)
                         throws NullPointerException,
                                IndexOutOfBoundsException,
                                InvalidXMLException
Checks if the specified part of a character array matches the S (white space) production.

See: Definition of S.

Parameters:
ch - the character array that contains the characters to be checked, cannot be null.
start - the start index into ch, must be >= 0.
length - the number of characters to take from ch, starting at the start index.
Throws:
NullPointerException - if ch == null.
IndexOutOfBoundsException - if start < 0 || start + length > ch.length.
InvalidXMLException - if the specified character string does not match the S production.

checkName

public static final void checkName(String name)
                            throws NullPointerException,
                                   InvalidXMLException
Checks if the specified string matches the Name production.

See: Definition of Name.

Parameters:
name - the character string to check, cannot be null.
Throws:
NullPointerException - if name == null.
InvalidXMLException - if the specified character string does not match the Name production.

isName

public static final boolean isName(String name)
                            throws NullPointerException
Determines if the specified string matches the Name production.

See: Definition of Name.

Parameters:
name - the character string to check, cannot be null.
Returns:
true if the String matches the production, or false otherwise.
Throws:
NullPointerException - if name == null.

checkName

public static final void checkName(char[] ch,
                                   int start,
                                   int length)
                            throws NullPointerException,
                                   IndexOutOfBoundsException,
                                   InvalidXMLException
Checks if the specified part of a character array matches the Name production.

See: Definition of Name.

Parameters:
ch - the character array that contains the characters to be checked, cannot be null.
start - the start index into ch, must be >= 0.
length - the number of characters to take from ch, starting at the start index.
Throws:
NullPointerException - if ch == null.
IndexOutOfBoundsException - if start < 0 || start + length > ch.length.
InvalidXMLException - if the specified character string does not match the Name production.


See http://xmlenc.sourceforge.net/.