| java.lang.Object net.n3.nanoxml.ValidatorPlugin
ValidatorPlugin | public class ValidatorPlugin implements IXMLValidator(Code) | | ValidatorPlugin allows the application to insert additional validators into
NanoXML.
author: Marc De Scheemaecker version: $Name: $, $Revision: 1.17 $ |
Method Summary | |
public void | PCDataAdded(String systemId, int lineNr) Indicates that a new #PCDATA element has been encountered. | public void | attributeAdded(String key, String value, String systemId, int lineNr) This method is called when the attributes of an XML element have been
processed. | public void | elementAttributesProcessed(String name, Properties extraAttributes, String systemId, int lineNr) Indicates that an attribute has been added to the current element. | public void | elementEnded(String name, String systemId, int lineNr) Indicates that the current element has ended. | public void | elementStarted(String name, String systemId, int lineNr) Indicates that an element has been started. | protected void | finalize() Cleans up the object when it's destroyed. | public IXMLValidator | getDelegate() Returns the delegate. | public IXMLEntityResolver | getParameterEntityResolver() Returns the parameter entity resolver. | public void | invalidAttributeValue(String systemID, int lineNr, String elementName, String attributeName, String attributeValue) Throws an XMLValidationException to indicate that an attribute has an
invalid value. | public void | missingAttribute(String systemID, int lineNr, String elementName, String attributeName) Throws an XMLValidationException to indicate that an attribute is
missing. | public void | missingElement(String systemID, int lineNr, String parentElementName, String missingElementName) Throws an XMLValidationException to indicate that an element is missing. | public void | missingPCData(String systemID, int lineNr, String parentElementName) Throws an XMLValidationException to indicate that a #PCDATA element was
missing. | public void | parseDTD(String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, boolean external) Parses the DTD. | public void | setDelegate(IXMLValidator delegate) Sets the delegate. | public void | setParameterEntityResolver(IXMLEntityResolver resolver) Sets the parameter entity resolver. | public void | unexpectedAttribute(String systemID, int lineNr, String elementName, String attributeName) Throws an XMLValidationException to indicate that an attribute is
unexpected. | public void | unexpectedElement(String systemID, int lineNr, String parentElementName, String unexpectedElementName) Throws an XMLValidationException to indicate that an element is
unexpected. | public void | unexpectedPCData(String systemID, int lineNr, String parentElementName) Throws an XMLValidationException to indicate that a #PCDATA element was
unexpected. | public void | validationError(String systemID, int lineNr, String message, String elementName, String attributeName, String attributeValue) Throws an XMLValidationException. |
ValidatorPlugin | public ValidatorPlugin()(Code) | | Initializes the plugin.
|
PCDataAdded | public void PCDataAdded(String systemId, int lineNr) throws Exception(Code) | | Indicates that a new #PCDATA element has been encountered.
Parameters: systemId - the system ID of the XML data of the element. Parameters: lineNr - the line number in the XML data of the element. throws: java.lang.Exception - if the element could not be validated. |
attributeAdded | public void attributeAdded(String key, String value, String systemId, int lineNr) throws Exception(Code) | | This method is called when the attributes of an XML element have been
processed.
If there are attributes with a default value which have not been
specified yet, they have to be put into extraAttributes.
Parameters: name - the name of the element. Parameters: extraAttributes - where to put extra attributes. Parameters: systemId - the system ID of the XML data of the element. Parameters: lineNr - the line number in the XML data of the element. throws: java.lang.Exception - if the element could not be validated. |
elementAttributesProcessed | public void elementAttributesProcessed(String name, Properties extraAttributes, String systemId, int lineNr) throws Exception(Code) | | Indicates that an attribute has been added to the current element.
Parameters: key - the name of the attribute. Parameters: value - the value of the attribute. Parameters: systemId - the system ID of the XML data of the element. Parameters: lineNr - the line number in the XML data of the element. throws: java.lang.Exception - if the attribute could not be validated. |
elementEnded | public void elementEnded(String name, String systemId, int lineNr) throws Exception(Code) | | Indicates that the current element has ended.
Parameters: name - the name of the element. Parameters: systemId - the system ID of the XML data of the element. Parameters: lineNr - the line number in the XML data of the element. throws: java.lang.Exception - if the element could not be validated. |
elementStarted | public void elementStarted(String name, String systemId, int lineNr) throws Exception(Code) | | Indicates that an element has been started.
Parameters: name - the name of the element. Parameters: systemId - the system ID of the XML data of the element. Parameters: lineNr - the line number in the XML data of the element. throws: java.lang.Exception - if the element could not be validated. |
finalize | protected void finalize() throws Throwable(Code) | | Cleans up the object when it's destroyed.
|
getParameterEntityResolver | public IXMLEntityResolver getParameterEntityResolver()(Code) | | Returns the parameter entity resolver.
the entity resolver. |
invalidAttributeValue | public void invalidAttributeValue(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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: elementName - the name of the element Parameters: attributeName - the name of the attribute Parameters: attributeValue - the value of the attribute throws: net.n3.nanoxml.XMLValidationException - of course :-) |
missingAttribute | public void missingAttribute(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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: elementName - the name of the element Parameters: attributeName - the name of the missing attribute throws: net.n3.nanoxml.XMLValidationException - of course :-) |
missingElement | public void missingElement(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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: parentElementName - the name of the parent element Parameters: missingElementName - the name of the missing element throws: net.n3.nanoxml.XMLValidationException - of course :-) |
missingPCData | public void missingPCData(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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: parentElementName - the name of the parent element throws: net.n3.nanoxml.XMLValidationException - of course :-) |
parseDTD | public void parseDTD(String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, boolean external) throws Exception(Code) | | Parses the DTD. The validator object is responsible for reading the
full DTD.
Parameters: publicID - the public ID, which may be null. Parameters: reader - the reader to read the DTD from. Parameters: entityResolver - the entity resolver. Parameters: external - true if the DTD is external. throws: java.lang.Exception - if something went wrong. |
setDelegate | public void setDelegate(IXMLValidator delegate)(Code) | | Sets the delegate.
Parameters: delegate - the delegate |
setParameterEntityResolver | public void setParameterEntityResolver(IXMLEntityResolver resolver)(Code) | | Sets the parameter entity resolver.
Parameters: resolver - the entity resolver. |
unexpectedAttribute | public void unexpectedAttribute(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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: elementName - the name of the element Parameters: attributeName - the name of the unexpected attribute throws: net.n3.nanoxml.XMLValidationException - of course :-) |
unexpectedElement | public void unexpectedElement(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 XML data of theelement Parameters: lineNr - the line number in the XML data of theelement Parameters: parentElementName - the name of the parent element Parameters: unexpectedElementName - the name of the missing element throws: net.n3.nanoxml.XMLValidationException - of course :-) |
unexpectedPCData | public void unexpectedPCData(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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: parentElementName - the name of the parent element throws: net.n3.nanoxml.XMLValidationException - of course :-) |
validationError | public 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 XML data of the element Parameters: lineNr - the line number in the XML data of the element Parameters: message - the error message Parameters: elementName - the name of the element (may be null) Parameters: attributeName - the name of the attribute (may be null) Parameters: attributeValue - the value of the attribute (may be null) throws: net.n3.nanoxml.XMLValidationException - of course :-) |
|
|