Class XMLChecker


  • public final class XMLChecker
    extends java.lang.Object
    Utility class that provides XML checking functionality.
    Since:
    xmlenc 0.41
    Version:
    $Revision: 1.11 $ $Date: 2005/09/12 08:40:02 $
    Author:
    Ernst de Haan (wfe.dehaan@gmail.com)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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​(java.lang.String s)
      Checks if the specified string matches the Name production.
      static void checkPubidLiteral​(char[] ch, int start, int length)
      Checks if the specified part of a character array matches the PubidLiteral production.
      static void checkPubidLiteral​(java.lang.String s)
      Checks if the specified string matches the PubidLiteral 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​(java.lang.String s)
      Checks if the specified string matches the S (white space) production.
      static void checkSystemLiteral​(char[] ch, int start, int length)
      Checks if the specified part of a character array matches the SystemLiteral production.
      static void checkSystemLiteral​(java.lang.String s)
      Checks if the specified string matches the SystemLiteral production.
      static boolean isName​(java.lang.String s)
      Determines if the specified string matches the Name production.
      static boolean isPubidLiteral​(java.lang.String s)
      Determines if the specified string matches the PubidLiteral production.
      static boolean isSystemLiteral​(java.lang.String s)
      Determines if the specified string matches the SystemLiteral 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​(java.lang.String s)
                                 throws java.lang.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:
        java.lang.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 java.lang.NullPointerException,
                                        java.lang.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:
        java.lang.NullPointerException - if ch == null.
        java.lang.IndexOutOfBoundsException - if start < 0 || start + length > ch.length.
        InvalidXMLException - if the specified character string does not match the S production.
      • isName

        public static final boolean isName​(java.lang.String s)
                                    throws java.lang.NullPointerException
        Determines if the specified string matches the Name production.

        See: Definition of Name.

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

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

        See: Definition of Name.

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

        public static final void checkName​(char[] ch,
                                           int start,
                                           int length)
                                    throws java.lang.NullPointerException,
                                           java.lang.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:
        java.lang.NullPointerException - if ch == null.
        java.lang.IndexOutOfBoundsException - if start < 0 || start + length > ch.length.
        InvalidXMLException - if the specified character string does not match the Name production.
      • isSystemLiteral

        public static final boolean isSystemLiteral​(java.lang.String s)
                                             throws java.lang.NullPointerException
        Determines if the specified string matches the SystemLiteral production.

        See: Definition of SystemLiteral.

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

        public static final void checkSystemLiteral​(java.lang.String s)
                                             throws java.lang.NullPointerException,
                                                    InvalidXMLException
        Checks if the specified string matches the SystemLiteral production.

        See: Definition of SystemLiteral.

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

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

        See: Definition of SystemLiteral.

        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:
        java.lang.NullPointerException - if ch == null.
        java.lang.IndexOutOfBoundsException - if start < 0 || start + length > ch.length.
        InvalidXMLException - if the specified character string does not match the SystemLiteral production.
      • isPubidLiteral

        public static final boolean isPubidLiteral​(java.lang.String s)
                                            throws java.lang.NullPointerException
        Determines if the specified string matches the PubidLiteral production.

        See: Definition of PubidLiteral.

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

        public static final void checkPubidLiteral​(java.lang.String s)
                                            throws java.lang.NullPointerException,
                                                   InvalidXMLException
        Checks if the specified string matches the PubidLiteral production.

        See: Definition of PubidLiteral.

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

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

        See: Definition of PubidLiteral.

        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:
        java.lang.NullPointerException - if ch == null.
        java.lang.IndexOutOfBoundsException - if start < 0 || start + length > ch.length.
        InvalidXMLException - if the specified character string does not match the PubidLiteral production.