| java.lang.Object net.n3.nanoxml.XMLUtil
XMLUtil | class XMLUtil (Code) | | Utility methods for NanoXML.
author: Marc De Scheemaecker version: $Name: RELEASE_2_2_1 $, $Revision: 1.5 $ |
Method Summary | |
static boolean | checkLiteral(IXMLReader reader, String literal) Returns true if the data starts with literal. | static void | errorClosingTagNotEmpty(String systemID, int lineNr) Throws an XMLParseException to indicate that extra data is encountered
in a closing tag. | static void | errorExpectedInput(String systemID, int lineNr, String expectedString) Throws an XMLParseException to indicate that an expected string is not
encountered. | static void | errorInvalidAttributeValue(String systemID, int lineNr, String elementName, String attributeName, String attributeValue) Throws an XMLValidationException to indicate that an attribute has an
invalid value. | static void | errorInvalidEntity(String systemID, int lineNr, String entity) Throws an XMLParseException to indicate that an entity could not be
resolved. | static void | errorInvalidInput(String systemID, int lineNr, String unexpectedString) Throws an XMLParseException to indicate that a string is not expected
at this point. | static void | errorMissingAttribute(String systemID, int lineNr, String elementName, String attributeName) Throws an XMLValidationException to indicate that an attribute is
missing. | static void | errorMissingElement(String systemID, int lineNr, String parentElementName, String missingElementName) Throws an XMLValidationException to indicate that an element is missing. | static void | errorMissingPCData(String systemID, int lineNr, String parentElementName) Throws an XMLValidationException to indicate that a #PCDATA element was
missing. | static void | errorUnexpectedAttribute(String systemID, int lineNr, String elementName, String attributeName) Throws an XMLValidationException to indicate that an attribute is
unexpected. | static void | errorUnexpectedCDATA(String systemID, int lineNr) Throws an XMLParseException to indicate that a CDATA section is
unexpected at this point. | static void | errorUnexpectedElement(String systemID, int lineNr, String parentElementName, String unexpectedElementName) Throws an XMLValidationException to indicate that an element is
unexpected. | static void | errorUnexpectedEntity(String systemID, int lineNr, String entity) Throws an XMLParseException to indicate that an entity reference is
unexpected at this point. | static void | errorUnexpectedPCData(String systemID, int lineNr, String parentElementName) Throws an XMLValidationException to indicate that a #PCDATA element was
unexpected. | static void | errorWrongClosingTag(String systemID, int lineNr, String expectedName, String wrongName) Throws an XMLParseException to indicate that the closing tag of an
element does not match the opening tag. | static char | processCharLiteral(String entity) Processes a character literal. | static void | processEntity(String entity, IXMLReader reader, IXMLEntityResolver entityResolver) Processes an entity. | static String | read(IXMLReader reader, char entityChar) Reads a character from the reader.
Parameters: reader - the reader Parameters: entityChar - the escape character (& or %) used to indicatean entity the character, or an entity expression (like e.g. | static char | readChar(IXMLReader reader, char entityChar) Reads a character from the reader disallowing entities. | static String | scanIdentifier(IXMLReader reader) Retrieves an identifier from the data. | static String | scanPublicID(StringBuffer publicID, IXMLReader reader) Scans a public ID. | static String | scanString(IXMLReader reader, char entityChar, IXMLEntityResolver entityResolver) Retrieves a delimited string from the data. | static String | scanSystemID(IXMLReader reader) Scans a system ID. | static void | skipComment(IXMLReader reader) Skips the remainder of a comment. | static void | skipTag(IXMLReader reader) Skips the remainder of the current XML tag. | static void | skipWhitespace(IXMLReader reader, StringBuffer buffer) Skips whitespace from the reader. | static void | validationError(String systemID, int lineNr, String message, String elementName, String attributeName, String attributeValue) Throws an XMLValidationException. |
checkLiteral | static boolean checkLiteral(IXMLReader reader, String literal) throws IOException, XMLParseException(Code) | | Returns true if the data starts with literal.
Enough chars are read to determine this result.
Parameters: reader - the reader Parameters: literal - the literal to check throws: java.io.IOException - if an error occurred reading the data |
errorClosingTagNotEmpty | static void errorClosingTagNotEmpty(String systemID, int lineNr) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that extra data is encountered
in a closing tag.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source |
errorExpectedInput | static void errorExpectedInput(String systemID, int lineNr, String expectedString) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that an expected string is not
encountered.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: expectedString - the string that is expected |
errorInvalidAttributeValue | static void errorInvalidAttributeValue(String systemID, int lineNr, String elementName, String attributeName, String attributeValue) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that an attribute has an
invalid value.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: elementName - the name of the element Parameters: attributeName - the name of the attribute Parameters: attributeValue - the value of that attribute |
errorInvalidEntity | static void errorInvalidEntity(String systemID, int lineNr, String entity) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that an entity could not be
resolved.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: entity - the name of the entity |
errorInvalidInput | static void errorInvalidInput(String systemID, int lineNr, String unexpectedString) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that a string is not expected
at this point.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: unexpectedString - the string that is unexpected |
errorMissingAttribute | static void errorMissingAttribute(String systemID, int lineNr, String elementName, String attributeName) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that an attribute is
missing.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: elementName - the name of the element Parameters: attributeName - the name of the missing attribute |
errorMissingElement | static void errorMissingElement(String systemID, int lineNr, String parentElementName, String missingElementName) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that an element is missing.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: parentElementName - the name of the parent element Parameters: missingElementName - the name of the missing element |
errorMissingPCData | static void errorMissingPCData(String systemID, int lineNr, String parentElementName) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that a #PCDATA element was
missing.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: parentElementName - the name of the parent element |
errorUnexpectedAttribute | static void errorUnexpectedAttribute(String systemID, int lineNr, String elementName, String attributeName) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that an attribute is
unexpected.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: elementName - the name of the element Parameters: attributeName - the name of the unexpected attribute |
errorUnexpectedCDATA | static void errorUnexpectedCDATA(String systemID, int lineNr) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that a CDATA section is
unexpected at this point.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source |
errorUnexpectedElement | static void errorUnexpectedElement(String systemID, int lineNr, String parentElementName, String unexpectedElementName) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that an element is
unexpected.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: parentElementName - the name of the parent element Parameters: unexpectedElementName - the name of the unexpected element |
errorUnexpectedEntity | static void errorUnexpectedEntity(String systemID, int lineNr, String entity) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that an entity reference is
unexpected at this point.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: entity - the name of the entity |
errorUnexpectedPCData | static void errorUnexpectedPCData(String systemID, int lineNr, String parentElementName) throws XMLValidationException(Code) | | Throws an XMLValidationException to indicate that a #PCDATA element was
unexpected.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: parentElementName - the name of the parent element |
errorWrongClosingTag | static void errorWrongClosingTag(String systemID, int lineNr, String expectedName, String wrongName) throws XMLParseException(Code) | | Throws an XMLParseException to indicate that the closing tag of an
element does not match the opening tag.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: expectedName - the name of the opening tag Parameters: wrongName - the name of the closing tag |
read | static String read(IXMLReader reader, char entityChar) throws IOException, XMLParseException(Code) | | Reads a character from the reader.
Parameters: reader - the reader Parameters: entityChar - the escape character (& or %) used to indicatean entity the character, or an entity expression (like e.g. <) throws: java.io.IOException - if an error occurred reading the data |
readChar | static char readChar(IXMLReader reader, char entityChar) throws IOException, XMLParseException(Code) | | Reads a character from the reader disallowing entities.
Parameters: reader - the reader Parameters: entityChar - the escape character (& or %) used to indicatean entity |
skipWhitespace | static void skipWhitespace(IXMLReader reader, StringBuffer buffer) throws IOException(Code) | | Skips whitespace from the reader.
Parameters: reader - the reader Parameters: buffer - where to put the whitespace; null if thewhitespace does not have to be stored. throws: java.io.IOException - if an error occurred reading the data |
validationError | static void validationError(String systemID, int lineNr, String message, String elementName, String attributeName, String attributeValue) throws XMLValidationException(Code) | | Throws an XMLValidationException.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line number in the data source Parameters: message - the error message Parameters: elementName - the name of the element Parameters: attributeName - the name of the attribute Parameters: attributeValue - the value of that attribute |
|
|