ValidatorPlugin allows the application to insert additional validators into
NanoXML.
PCDataAdded
public void PCDataAdded(String systemId,
int lineNr)
throws Exception
Indicates that a new #PCDATA element has been encountered.
- PCDataAdded in interface IXMLValidator
systemId
- the system ID of the XML data of the element.lineNr
- the line number in the XML data of the element.
attributeAdded
public void attributeAdded(String key,
String value,
String systemId,
int lineNr)
throws Exception
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.
- attributeAdded in interface IXMLValidator
systemId
- the system ID of the XML data of the element.lineNr
- the line number in the XML data of the element.
elementAttributesProcessed
public void elementAttributesProcessed(String name,
Properties extraAttributes,
String systemId,
int lineNr)
throws Exception
Indicates that an attribute has been added to the current element.
- elementAttributesProcessed in interface IXMLValidator
systemId
- the system ID of the XML data of the element.lineNr
- the line number in the XML data of the element.
elementEnded
public void elementEnded(String name,
String systemId,
int lineNr)
throws Exception
Indicates that the current element has ended.
- elementEnded in interface IXMLValidator
name
- the name of the element.systemId
- the system ID of the XML data of the element.lineNr
- the line number in the XML data of the element.
elementStarted
public void elementStarted(String name,
String systemId,
int lineNr)
throws Exception
Indicates that an element has been started.
- elementStarted in interface IXMLValidator
name
- the name of the element.systemId
- the system ID of the XML data of the element.lineNr
- the line number in the XML data of the element.
finalize
protected void finalize()
throws Throwable
Cleans up the object when it's destroyed.
getDelegate
public IXMLValidator getDelegate()
Returns the delegate.
invalidAttributeValue
public void invalidAttributeValue(String systemID,
int lineNr,
String elementName,
String attributeName,
String attributeValue)
throws XMLValidationException
Throws an XMLValidationException to indicate that an attribute has an
invalid value.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementelementName
- the name of the elementattributeName
- the name of the attributeattributeValue
- the value of the attribute
XMLValidationException
- of course :-)
missingAttribute
public void missingAttribute(String systemID,
int lineNr,
String elementName,
String attributeName)
throws XMLValidationException
Throws an XMLValidationException to indicate that an attribute is
missing.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementelementName
- the name of the elementattributeName
- the name of the missing attribute
XMLValidationException
- of course :-)
missingElement
public void missingElement(String systemID,
int lineNr,
String parentElementName,
String missingElementName)
throws XMLValidationException
Throws an XMLValidationException to indicate that an element is missing.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementparentElementName
- the name of the parent elementmissingElementName
- the name of the missing element
XMLValidationException
- of course :-)
missingPCData
public void missingPCData(String systemID,
int lineNr,
String parentElementName)
throws XMLValidationException
Throws an XMLValidationException to indicate that a #PCDATA element was
missing.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementparentElementName
- the name of the parent element
XMLValidationException
- of course :-)
parseDTD
public void parseDTD(String publicID,
IXMLReader reader,
IXMLEntityResolver entityResolver,
boolean external)
throws Exception
Parses the DTD. The validator object is responsible for reading the
full DTD.
- parseDTD in interface IXMLValidator
publicID
- the public ID, which may be null.reader
- the reader to read the DTD from.entityResolver
- the entity resolver.external
- true if the DTD is external.
setDelegate
public void setDelegate(IXMLValidator delegate)
Sets the delegate.
delegate
- the delegate
unexpectedAttribute
public void unexpectedAttribute(String systemID,
int lineNr,
String elementName,
String attributeName)
throws XMLValidationException
Throws an XMLValidationException to indicate that an attribute is
unexpected.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementelementName
- the name of the elementattributeName
- the name of the unexpected attribute
XMLValidationException
- of course :-)
unexpectedElement
public void unexpectedElement(String systemID,
int lineNr,
String parentElementName,
String unexpectedElementName)
throws XMLValidationException
Throws an XMLValidationException to indicate that an element is
unexpected.
systemID
- the system ID of the XML data of the
elementlineNr
- the line number in the XML data of the
elementparentElementName
- the name of the parent elementunexpectedElementName
- the name of the missing element
XMLValidationException
- of course :-)
unexpectedPCData
public void unexpectedPCData(String systemID,
int lineNr,
String parentElementName)
throws XMLValidationException
Throws an XMLValidationException to indicate that a #PCDATA element was
unexpected.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementparentElementName
- the name of the parent element
XMLValidationException
- of course :-)
validationError
public void validationError(String systemID,
int lineNr,
String message,
String elementName,
String attributeName,
String attributeValue)
throws XMLValidationException
Throws an XMLValidationException.
systemID
- the system ID of the XML data of the elementlineNr
- the line number in the XML data of the elementmessage
- the error messageelementName
- the name of the element (may be null)attributeName
- the name of the attribute (may be null)attributeValue
- the value of the attribute (may be null)
XMLValidationException
- of course :-)