|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.n3.nanoxml.XMLUtil
class XMLUtil
Utility methods for NanoXML.
| Constructor Summary | |
|---|---|
XMLUtil()
|
|
| Method Summary | |
|---|---|
(package private) static boolean |
checkLiteral(IXMLReader reader,
java.lang.String literal)
Returns true if the data starts with literal. |
(package private) static void |
errorClosingTagNotEmpty(java.lang.String systemID,
int lineNr)
Throws an XMLParseException to indicate that extra data is encountered in a closing tag. |
(package private) static void |
errorExpectedInput(java.lang.String systemID,
int lineNr,
java.lang.String expectedString)
Throws an XMLParseException to indicate that an expected string is not encountered. |
(package private) static void |
errorInvalidAttributeValue(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeValue)
Throws an XMLValidationException to indicate that an attribute has an invalid value. |
(package private) static void |
errorInvalidEntity(java.lang.String systemID,
int lineNr,
java.lang.String entity)
Throws an XMLParseException to indicate that an entity could not be resolved. |
(package private) static void |
errorInvalidInput(java.lang.String systemID,
int lineNr,
java.lang.String unexpectedString)
Throws an XMLParseException to indicate that a string is not expected at this point. |
(package private) static void |
errorMissingAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
Throws an XMLValidationException to indicate that an attribute is missing. |
(package private) static void |
errorMissingElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String missingElementName)
Throws an XMLValidationException to indicate that an element is missing. |
(package private) static void |
errorMissingPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
Throws an XMLValidationException to indicate that a #PCDATA element was missing. |
(package private) static void |
errorUnexpectedAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
Throws an XMLValidationException to indicate that an attribute is unexpected. |
(package private) static void |
errorUnexpectedCDATA(java.lang.String systemID,
int lineNr)
Throws an XMLParseException to indicate that a CDATA section is unexpected at this point. |
(package private) static void |
errorUnexpectedElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String unexpectedElementName)
Throws an XMLValidationException to indicate that an element is unexpected. |
(package private) static void |
errorUnexpectedEntity(java.lang.String systemID,
int lineNr,
java.lang.String entity)
Throws an XMLParseException to indicate that an entity reference is unexpected at this point. |
(package private) static void |
errorUnexpectedPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
Throws an XMLValidationException to indicate that a #PCDATA element was unexpected. |
(package private) static void |
errorWrongClosingTag(java.lang.String systemID,
int lineNr,
java.lang.String expectedName,
java.lang.String wrongName)
Throws an XMLParseException to indicate that the closing tag of an element does not match the opening tag. |
(package private) static char |
processCharLiteral(java.lang.String entity)
Processes a character literal. |
(package private) static void |
processEntity(java.lang.String entity,
IXMLReader reader,
IXMLEntityResolver entityResolver)
Processes an entity. |
(package private) static java.lang.String |
read(IXMLReader reader,
char entityChar)
Reads a character from the reader. |
(package private) static char |
readChar(IXMLReader reader,
char entityChar)
Reads a character from the reader disallowing entities. |
(package private) static java.lang.String |
scanIdentifier(IXMLReader reader)
Retrieves an identifier from the data. |
(package private) static java.lang.String |
scanPublicID(java.lang.StringBuffer publicID,
IXMLReader reader)
Scans a public ID. |
(package private) static java.lang.String |
scanString(IXMLReader reader,
char entityChar,
IXMLEntityResolver entityResolver)
Retrieves a delimited string from the data. |
(package private) static java.lang.String |
scanSystemID(IXMLReader reader)
Scans a system ID. |
(package private) static void |
skipComment(IXMLReader reader)
Skips the remainder of a comment. |
(package private) static void |
skipTag(IXMLReader reader)
Skips the remainder of the current XML tag. |
(package private) static void |
skipWhitespace(IXMLReader reader,
java.lang.StringBuffer buffer)
Skips whitespace from the reader. |
(package private) static void |
validationError(java.lang.String systemID,
int lineNr,
java.lang.String message,
java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeValue)
Throws an XMLValidationException. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
XMLUtil()
| Method Detail |
|---|
static void skipComment(IXMLReader reader)
throws java.io.IOException,
XMLParseException
reader - the reader
java.io.IOException - if an error occurred reading the data
XMLParseException
static void skipTag(IXMLReader reader)
throws java.io.IOException,
XMLParseException
reader - the reader
java.io.IOException - if an error occurred reading the data
XMLParseException
static java.lang.String scanPublicID(java.lang.StringBuffer publicID,
IXMLReader reader)
throws java.io.IOException,
XMLParseException
publicID - will contain the public IDreader - the reader
java.io.IOException - if an error occurred reading the data
XMLParseException
static java.lang.String scanSystemID(IXMLReader reader)
throws java.io.IOException,
XMLParseException
reader - the reader
java.io.IOException - if an error occurred reading the data
XMLParseException
static java.lang.String scanIdentifier(IXMLReader reader)
throws java.io.IOException,
XMLParseException
reader - the reader
java.io.IOException - if an error occurred reading the data
XMLParseException
static java.lang.String scanString(IXMLReader reader,
char entityChar,
IXMLEntityResolver entityResolver)
throws java.io.IOException,
XMLParseException
reader - the readerentityChar - the escape character (& or %)entityResolver - the entity resolver
java.io.IOException - if an error occurred reading the data
XMLParseException
static void processEntity(java.lang.String entity,
IXMLReader reader,
IXMLEntityResolver entityResolver)
throws java.io.IOException,
XMLParseException
entity - the entityreader - the readerentityResolver - the entity resolver
java.io.IOException - if an error occurred reading the data
XMLParseException
static char processCharLiteral(java.lang.String entity)
throws java.io.IOException,
XMLParseException
entity - the entity
java.io.IOException - if an error occurred reading the data
XMLParseException
static void skipWhitespace(IXMLReader reader,
java.lang.StringBuffer buffer)
throws java.io.IOException
reader - the readerbuffer - where to put the whitespace; null if the
whitespace does not have to be stored.
java.io.IOException - if an error occurred reading the data
static java.lang.String read(IXMLReader reader,
char entityChar)
throws java.io.IOException,
XMLParseException
reader - the readerentityChar - the escape character (& or %) used to indicate
an entity
java.io.IOException - if an error occurred reading the data
XMLParseException
static char readChar(IXMLReader reader,
char entityChar)
throws java.io.IOException,
XMLParseException
reader - the readerentityChar - the escape character (& or %) used to indicate
an entity
java.io.IOException
XMLParseException
static boolean checkLiteral(IXMLReader reader,
java.lang.String literal)
throws java.io.IOException,
XMLParseException
reader - the readerliteral - the literal to check
java.io.IOException - if an error occurred reading the data
XMLParseException
static void errorExpectedInput(java.lang.String systemID,
int lineNr,
java.lang.String expectedString)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceexpectedString - the string that is expected
XMLParseException
static void errorInvalidEntity(java.lang.String systemID,
int lineNr,
java.lang.String entity)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceentity - the name of the entity
XMLParseException
static void errorUnexpectedEntity(java.lang.String systemID,
int lineNr,
java.lang.String entity)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceentity - the name of the entity
XMLParseException
static void errorUnexpectedCDATA(java.lang.String systemID,
int lineNr)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data source
XMLParseException
static void errorInvalidInput(java.lang.String systemID,
int lineNr,
java.lang.String unexpectedString)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceunexpectedString - the string that is unexpected
XMLParseException
static void errorWrongClosingTag(java.lang.String systemID,
int lineNr,
java.lang.String expectedName,
java.lang.String wrongName)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceexpectedName - the name of the opening tagwrongName - the name of the closing tag
XMLParseException
static void errorClosingTagNotEmpty(java.lang.String systemID,
int lineNr)
throws XMLParseException
systemID - the system ID of the data sourcelineNr - the line number in the data source
XMLParseException
static void errorMissingElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String missingElementName)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceparentElementName - the name of the parent elementmissingElementName - the name of the missing element
XMLValidationException
static void errorUnexpectedElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String unexpectedElementName)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceparentElementName - the name of the parent elementunexpectedElementName - the name of the unexpected element
XMLValidationException
static void errorMissingAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceelementName - the name of the elementattributeName - the name of the missing attribute
XMLValidationException
static void errorUnexpectedAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceelementName - the name of the elementattributeName - the name of the unexpected attribute
XMLValidationException
static void errorInvalidAttributeValue(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeValue)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceelementName - the name of the elementattributeName - the name of the attributeattributeValue - the value of that attribute
XMLValidationException
static void errorMissingPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceparentElementName - the name of the parent element
XMLValidationException
static void errorUnexpectedPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourceparentElementName - the name of the parent element
XMLValidationException
static void validationError(java.lang.String systemID,
int lineNr,
java.lang.String message,
java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeValue)
throws XMLValidationException
systemID - the system ID of the data sourcelineNr - the line number in the data sourcemessage - the error messageelementName - the name of the elementattributeName - the name of the attributeattributeValue - the value of that attribute
XMLValidationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||