All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.jdom.Verifier

java.lang.Object
   |
   +----org.jdom.Verifier

public final class Verifier
extends Object

Verifier handles XML checks on names, data, and other verification tasks for JDOM.

Version:
$Revision: 1.32 $, $Date: 2002/03/12 07:57:06 $
Author:
Brett McLaughlin, Elliotte Rusty Harold, Jason Hunter, Bradley S. Huffman

Method Index

 o checkAttributeName(String)

This will check the supplied name to see if it is legal for use as a JDOM {

 o checkCDATASection(String)

This will check the supplied data to see if it is legal for use as JDOM {

 o checkCharacterData(String)

This will check the supplied string to see if it only contains characters allowed by the XML 1.0 specification.

 o checkCommentData(String)

This will check the supplied data to see if it is legal for use as JDOM {

 o checkElementName(String)

This will check the supplied name to see if it is legal for use as a JDOM {

 o checkNamespaceCollision(Attribute, Element)

Check if {

 o checkNamespaceCollision(Namespace, Attribute)

Check if a {

 o checkNamespaceCollision(Namespace, Element)

Check if a {

 o checkNamespaceCollision(Namespace, List)

Check if a {

 o checkNamespaceCollision(Namespace, Namespace)

Check if two namespaces collide.

 o checkNamespacePrefix(String)

This will check the supplied name to see if it is legal for use as a JDOM {

 o checkNamespaceURI(String)

This will check the supplied name to see if it is legal for use as a JDOM {

 o checkProcessingInstructionTarget(String)

This will check the supplied data to see if it is legal for use as a JDOM {

 o checkPublicID(String)

This will ensure that the data for a public identifier is legal.

 o checkSystemLiteral(String)

This will ensure that the data for a system literal is legal.

 o checkXMLName(String)

This is a utility function for sharing the base process of checking any XML name.

 o isXMLCharacter(char)

This is a utility function for determining whether a specified character is a character according to production 2 of the XML 1.0 specification.

 o isXMLCombiningChar(char)

This is a utility function for determining whether a specified character is a combining character according to production 87 of the XML 1.0 specification.

 o isXMLDigit(char)

This is a utility function for determining whether a specified Unicode character is a digit according to production 88 of the XML 1.0 specification.

 o isXMLExtender(char)

This is a utility function for determining whether a specified character is an extender according to production 88 of the XML 1.0 specification.

 o isXMLLetter(char)

This is a utility function for determining whether a specified character is a letter according to production 84 of the XML 1.0 specification.

 o isXMLLetterOrDigit(char)

This is a utility function for determining whether a specified character is a letter or digit according to productions 84 and 88 of the XML 1.0 specification.

 o isXMLNameCharacter(char)

This is a utility function for determining whether a specified character is a name character according to production 4 of the XML 1.0 specification.

 o isXMLNameStartCharacter(char)

This is a utility function for determining whether a specified character is a legal name start character according to production 5 of the XML 1.0 specification.

 o main(String[])

Methods

 o checkElementName
 public static final String checkElementName(String name)

This will check the supplied name to see if it is legal for use as a JDOM {@link Element} name.

Parameters:
name - String name to check.
Returns:
String - reason name is illegal, or null if name is OK.
 o checkAttributeName
 public static final String checkAttributeName(String name)

This will check the supplied name to see if it is legal for use as a JDOM {@link Attribute} name.

Parameters:
name - String name to check.
Returns:
String - reason name is illegal, or null if name is OK.
 o checkCharacterData
 public static final String checkCharacterData(String text)

This will check the supplied string to see if it only contains characters allowed by the XML 1.0 specification. The C0 controls (e.g. null, vertical tab, formfeed, etc.) are specifically excluded except for carriage return, linefeed, and the horizontal tab. Surrogates are also excluded.

This method is useful for checking element content and attribute values. Note that characters like " and < are allowed in attribute values and element content. They will simply be escaped as " or < when the value is serialized.

Parameters:
name - String value to check.
Returns:
String - reason name is illegal, or null if name is OK.
 o checkCDATASection
 public static final String checkCDATASection(String data)

This will check the supplied data to see if it is legal for use as JDOM {@link CDATA}.

Parameters:
data - String data to check.
Returns:
String - reason data is illegal, or null is name is OK.
 o checkNamespacePrefix
 public static final String checkNamespacePrefix(String prefix)

This will check the supplied name to see if it is legal for use as a JDOM {@link Namespace} prefix.

Parameters:
prefix - String prefix to check.
Returns:
String - reason name is illegal, or null if name is OK.
 o checkNamespaceURI
 public static final String checkNamespaceURI(String uri)

This will check the supplied name to see if it is legal for use as a JDOM {@link Namespace} URI.

Parameters:
uri - String URI to check.
Returns:
String - reason name is illegal, or null if name is OK.
 o checkNamespaceCollision
 public static final String checkNamespaceCollision(Namespace namespace,
                                                    Namespace other)

Check if two namespaces collide.

Parameters:
namespace - Namespace to check.
other - Namespace to check agianst.
Returns:
String - reason for collision, or null if no collision.
 o checkNamespaceCollision
 public static final String checkNamespaceCollision(Attribute attribute,
                                                    Element element)

Check if {@link Attribute}'s namespace collides with a {@link Element}'s namespace.

Parameters:
attribute - Attribute to check.
element - Element to check agianst.
Returns:
String - reason for collision, or null if no collision.
 o checkNamespaceCollision
 public static final String checkNamespaceCollision(Namespace namespace,
                                                    Element element)

Check if a {@link Namespace} collides with a {@link Element}'s namespace.

Parameters:
namespace - Namespace to check.
element - Element to check agianst.
Returns:
String - reason for collision, or null if no collision.
 o checkNamespaceCollision
 public static final String checkNamespaceCollision(Namespace namespace,
                                                    Attribute attribute)

Check if a {@link Namespace} collides with a {@link Attribute}'s namespace.

Parameters:
namespace - Namespace to check.
attribute - Attribute to check agianst.
Returns:
String - reason for collision, or null if no collision.
 o checkNamespaceCollision
 public static final String checkNamespaceCollision(Namespace namespace,
                                                    List list)

Check if a {@link Namespace} collides with any namespace from a list of objects.

Parameters:
namespace - Namespace to check.
list - List to check agianst.
Returns:
String - reason for collision, or null if no collision.
 o checkProcessingInstructionTarget
 public static final String checkProcessingInstructionTarget(String target)

This will check the supplied data to see if it is legal for use as a JDOM {@link ProcessingInstruction} target.

Parameters:
target - String target to check.
Returns:
String - reason target is illegal, or null if target is OK.
 o checkCommentData
 public static final String checkCommentData(String data)

This will check the supplied data to see if it is legal for use as JDOM {@link Comment} data.

Parameters:
data - String data to check.
Returns:
String - reason data is illegal, or null if data is OK.
 o checkPublicID
 public static final String checkPublicID(String publicID)

This will ensure that the data for a public identifier is legal.

Parameters:
publicID - String public ID to check.
Returns:
String - reason public ID is illegal, or null if public ID is OK.
 o checkSystemLiteral
 public static final String checkSystemLiteral(String systemLiteral)

This will ensure that the data for a system literal is legal.

Parameters:
systemLiteral - String system literal to check.
Returns:
String - reason system literal is illegal, or null if system literal is OK.
 o checkXMLName
 public static String checkXMLName(String name)

This is a utility function for sharing the base process of checking any XML name.

Parameters:
name - String to check for XML name compliance.
Returns:
String - reason the name is illegal, or null if OK.
 o isXMLCharacter
 public static boolean isXMLCharacter(char c)

This is a utility function for determining whether a specified character is a character according to production 2 of the XML 1.0 specification.

Parameters:
c - char to check for XML compliance.
Returns:
boolean - true if it's a character, false otherwise.
 o isXMLNameCharacter
 public static boolean isXMLNameCharacter(char c)

This is a utility function for determining whether a specified character is a name character according to production 4 of the XML 1.0 specification.

Parameters:
c - char to check for XML name compliance.
Returns:
boolean - true if it's a name character, false otherwise.
 o isXMLNameStartCharacter
 public static boolean isXMLNameStartCharacter(char c)

This is a utility function for determining whether a specified character is a legal name start character according to production 5 of the XML 1.0 specification. This production does allow names to begin with colons which the Namespaces in XML Recommendation disallows.

Parameters:
c - char to check for XML name start compliance.
Returns:
boolean - true if it's a name start character, false otherwise.
 o isXMLLetterOrDigit
 public static boolean isXMLLetterOrDigit(char c)

This is a utility function for determining whether a specified character is a letter or digit according to productions 84 and 88 of the XML 1.0 specification.

Parameters:
c - char to check.
Returns:
boolean - true if it's letter or digit, false otherwise.
 o isXMLLetter
 public static boolean isXMLLetter(char c)

This is a utility function for determining whether a specified character is a letter according to production 84 of the XML 1.0 specification.

Parameters:
c - char to check for XML name compliance.
Returns:
String - true if it's a letter, false otherwise.
 o isXMLCombiningChar
 public static boolean isXMLCombiningChar(char c)

This is a utility function for determining whether a specified character is a combining character according to production 87 of the XML 1.0 specification.

Parameters:
c - char to check.
Returns:
boolean - true if it's a combining character, false otherwise.
 o isXMLExtender
 public static boolean isXMLExtender(char c)

This is a utility function for determining whether a specified character is an extender according to production 88 of the XML 1.0 specification.

Parameters:
c - char to check.
Returns:
String - true if it's an extender, false otherwise.
 o isXMLDigit
 public static boolean isXMLDigit(char c)

This is a utility function for determining whether a specified Unicode character is a digit according to production 88 of the XML 1.0 specification.

Parameters:
c - char to check for XML digit compliance.
Returns:
boolean - true if it's a digit, false otherwise.
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index