|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cdmckay.coffeedom.Verifier
public final class Verifier
A utility class to handle well-formedness checks on names, data, and other verification tasks for CoffeeDOM. The class is final and may not be subclassed.
Method Summary | |
---|---|
static String |
checkAttributeName(String name)
This will check the supplied name to see if it is legal for use as a CoffeeDOM name. |
static String |
checkCDATASection(String data)
This will check the supplied data to see if it is legal for use as CoffeeDOM . |
static String |
checkCharacterData(String text)
This will check the supplied string to see if it only contains characters allowed by the XML 1.0 specification. |
static String |
checkCommentData(String data)
This will check the supplied data to see if it is legal for use as CoffeeDOM data. |
static String |
checkElementName(String name)
This will check the supplied name to see if it is legal for use as a CoffeeDOM name. |
static String |
checkNamespaceCollision(Attribute attribute,
Element element)
Check if 's namespace collides with a 's namespace. |
static String |
checkNamespaceCollision(Namespace namespace,
Attribute attribute)
Check if a collides with a 's namespace. |
static String |
checkNamespaceCollision(Namespace namespace,
Element element)
Check if a collides with a 's namespace. |
static String |
checkNamespaceCollision(Namespace namespace,
List<?> list)
Check if a collides with any namespace from a list of objects. |
static String |
checkNamespaceCollision(Namespace namespace,
Namespace other)
Check if two namespaces collide. |
static String |
checkNamespacePrefix(String prefix)
This will check the supplied name to see if it is legal for use as a CoffeeDOM prefix. |
static String |
checkNamespaceURI(String uri)
This will check the supplied name to see if it is legal for use as a CoffeeDOM URI. |
static String |
checkProcessingInstructionData(String data)
This will check the supplied data to see if it is legal for use as
data. |
static String |
checkProcessingInstructionTarget(String target)
This will check the supplied data to see if it is legal for use as a CoffeeDOM target. |
static String |
checkPublicID(String publicID)
This will ensure that the data for a public identifier is legal. |
static String |
checkSystemLiteral(String systemLiteral)
This will ensure that the data for a system literal is legal. |
static String |
checkURI(String uri)
Checks a string to see if it is a legal RFC 2396 URI. |
static String |
checkXMLName(String name)
This is a utility function for sharing the base process of checking any XML name. |
static int |
decodeSurrogatePair(char high,
char low)
This is a utility function to decode a non-BMP UTF-16 surrogate pair. |
static boolean |
isHexDigit(char ch)
This is a utility function for determining whether a specified Unicode character is a hexadecimal digit as defined in RFC 2396; that is, one of the ASCII characters 0-9, a-f, or A-F. |
static boolean |
isHighSurrogate(char ch)
This is a function for determining whether the specified character is the high 16 bits in a UTF-16 surrogate pair. |
static boolean |
isLowSurrogate(char ch)
This is a function for determining whether the specified character is the low 16 bits in a UTF-16 surrogate pair. |
static boolean |
isURICharacter(char ch)
This is a utility function for determining whether a specified Unicode character is legal in URI references as determined by RFC 2396. |
static boolean |
isXMLCharacter(int ch)
This is a utility function for determining whether a specified character is a character according to production 2 of the XML 1.0 specification. |
static boolean |
isXMLCombiningChar(char ch)
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. |
static boolean |
isXMLDigit(char ch)
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. |
static boolean |
isXMLExtender(char ch)
This is a utility function for determining whether a specified character is an extender according to production 88 of the XML 1.0 specification. |
static boolean |
isXMLLetter(char ch)
This is a utility function for determining whether a specified character is a letter according to production 84 of the XML 1.0 specification. |
static boolean |
isXMLLetterOrDigit(char ch)
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. |
static boolean |
isXMLNameCharacter(char ch)
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. |
static boolean |
isXMLNameStartCharacter(char ch)
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. |
static boolean |
isXMLPublicIDCharacter(char ch)
|
static boolean |
isXMLWhitespace(char ch)
This is a utility function for determining whether a specified Unicode character is a whitespace character according to production 3 of the XML 1.0 specification. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String checkElementName(String name)
Element
name.
name
- String
name to check.
String
reason name is illegal, or null
if name is OK.public static String checkAttributeName(String name)
Attribute
name.
name
- String
name to check.
String
reason name is illegal, or null
if name is OK.public static String checkCharacterData(String text)
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.
text
- String
value to check.
String
reason name is illegal, or null
if name is OK.public static String checkCDATASection(String data)
CDATA
.
data
- String
data to check.
String
reason data is illegal, or null
is name is OK.public static String checkNamespacePrefix(String prefix)
Namespace
prefix.
prefix
- String
prefix to check.
String
reason name is illegal, or null
if name is OK.public static String checkNamespaceURI(String uri)
Namespace
URI.
uri
- String
URI to check.
String
reason name is illegal, or null
if name is OK.public static String checkNamespaceCollision(Namespace namespace, Namespace other)
namespace
- Namespace
to check.other
- Namespace
to check against.
String
reason for collision, or null
if no collision.public static String checkNamespaceCollision(Attribute attribute, Element element)
Attribute
's namespace collides with a Element
's namespace.
attribute
- Attribute
to check.element
- Element
to check against.
String
reason for collision, or null
if no collision.public static String checkNamespaceCollision(Namespace namespace, Element element)
Namespace
collides with a Element
's namespace.
namespace
- Namespace
to check.element
- Element
to check against.
String
reason for collision, or null
if no collision.public static String checkNamespaceCollision(Namespace namespace, Attribute attribute)
Namespace
collides with a Attribute
's namespace.
namespace
- Namespace
to check.attribute
- Attribute
to check against.
String
reason for collision, or null
if no collision.public static String checkNamespaceCollision(Namespace namespace, List<?> list)
Namespace
collides with any namespace from a list of objects.
namespace
- Namespace
to check.list
- List
of attributes, elements or namespaces to check against.
String
reason for collision, or null
if no collision.public static String checkProcessingInstructionTarget(String target)
ProcessingInstruction
target.
target
- String
target to check.
String
reason target is illegal, or null
if target is OK.public static String checkProcessingInstructionData(String data)
ProcessingInstruction
data. Besides checking that all the characters are allowed in XML, this also checks that the data does not
contain the PI end-string "?>".
data
- String
data to check.
String
reason data is illegal, or null
if data is OK.public static String checkCommentData(String data)
Comment
data.
data
- String
data to check.
String
reason data is illegal, or null
if data is OK.public static int decodeSurrogatePair(char high, char low)
high
- high 16 bitslow
- low 16 bits
public static boolean isXMLPublicIDCharacter(char ch)
public static String checkPublicID(String publicID)
publicID
- String
public ID to check.
String
reason public ID is illegal, or null
if public ID is OK.public static String checkSystemLiteral(String systemLiteral)
systemLiteral
- String
system literal to check.
String
reason system literal is illegal, or null
if system literal is OK.public static String checkXMLName(String name)
name
- String
to check for XML name compliance.
String
reason the name is illegal, or null
if OK.public static String checkURI(String uri)
Checks a string to see if it is a legal RFC 2396 URI. Both absolute and relative URIs are supported.
uri
- String
to check.
String
reason the URI is illegal, or null
if OK.public static boolean isHexDigit(char ch)
This is a utility function for determining whether a specified Unicode character is a hexadecimal digit as defined in RFC 2396; that is, one of the ASCII characters 0-9, a-f, or A-F.
ch
- to check for hex digit.
public static boolean isHighSurrogate(char ch)
ch
- character to check
public static boolean isLowSurrogate(char ch)
ch
- character to check
public static boolean isURICharacter(char ch)
This is a utility function for determining whether a specified Unicode character is legal in URI references as determined by RFC 2396.
ch
- char
to check for URI reference compliance.
public static boolean isXMLCharacter(int ch)
ch
- char
to check for XML compliance
boolean
true if it's a character, false otherwisepublic static boolean isXMLNameCharacter(char ch)
ch
- char
to check for XML name compliance.
boolean
true if it's a name character, false otherwise.public static boolean isXMLNameStartCharacter(char ch)
ch
- char
to check for XML name start compliance.
boolean
true if it's a name start character, false otherwise.public static boolean isXMLLetterOrDigit(char ch)
ch
- char
to check.
boolean
true if it's letter or digit, false otherwise.public static boolean isXMLLetter(char ch)
ch
- char
to check for XML name compliance.
String
true if it's a letter, false otherwise.public static boolean isXMLCombiningChar(char ch)
ch
- char
to check.
boolean
true if it's a combining character, false otherwise.public static boolean isXMLExtender(char ch)
ch
- char
to check.
String
true if it's an extender, false otherwise.public static boolean isXMLDigit(char ch)
ch
- char
to check for XML digit compliance
boolean
true if it's a digit, false otherwisepublic static boolean isXMLWhitespace(char ch)
ch
- char
to check for XML whitespace compliance
boolean
true if it's a whitespace, false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |