|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.n3.nanoxml.ValidatorPlugin
public class ValidatorPlugin
ValidatorPlugin allows the application to insert additional validators into NanoXML.
| Constructor Summary | |
|---|---|
ValidatorPlugin()
Initializes the plugin. |
|
| Method Summary | |
|---|---|
void |
attributeAdded(java.lang.String key,
java.lang.String value,
java.lang.String systemId,
int lineNr)
This method is called when the attributes of an XML element have been processed. |
void |
elementAttributesProcessed(java.lang.String name,
java.util.Properties extraAttributes,
java.lang.String systemId,
int lineNr)
Indicates that an attribute has been added to the current element. |
void |
elementEnded(java.lang.String name,
java.lang.String systemId,
int lineNr)
Indicates that the current element has ended. |
void |
elementStarted(java.lang.String name,
java.lang.String systemId,
int lineNr)
Indicates that an element has been started. |
protected void |
finalize()
Cleans up the object when it's destroyed. |
IXMLEntityResolver |
getParameterEntityResolver()
Returns the parameter entity resolver. |
IXMLValidator |
getvalidator()
Returns the validator. |
void |
invalidAttributeValue(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. |
void |
missingAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
Throws an XMLValidationException to indicate that an attribute is missing. |
void |
missingElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String missingElementName)
Throws an XMLValidationException to indicate that an element is missing. |
void |
missingPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
Throws an XMLValidationException to indicate that a #PCDATA element was missing. |
void |
parseDTD(java.lang.String publicID,
IXMLReader reader,
IXMLEntityResolver entityResolver,
boolean external)
Parses the DTD. |
void |
PCDataAdded(java.lang.String systemId,
int lineNr)
Indicates that a new #PCDATA element has been encountered. |
void |
setParameterEntityResolver(IXMLEntityResolver resolver)
Sets the parameter entity resolver. |
void |
setvalidator(IXMLValidator validator)
Sets the validator. |
void |
unexpectedAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
Throws an XMLValidationException to indicate that an attribute is unexpected. |
void |
unexpectedElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String unexpectedElementName)
Throws an XMLValidationException to indicate that an element is unexpected. |
void |
unexpectedPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
Throws an XMLValidationException to indicate that a #PCDATA element was unexpected. |
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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ValidatorPlugin()
| Method Detail |
|---|
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic IXMLValidator getvalidator()
public void setvalidator(IXMLValidator validator)
validator - the validatorpublic void setParameterEntityResolver(IXMLEntityResolver resolver)
setParameterEntityResolver in interface IXMLValidatorresolver - the entity resolver.public IXMLEntityResolver getParameterEntityResolver()
getParameterEntityResolver in interface IXMLValidator
public void parseDTD(java.lang.String publicID,
IXMLReader reader,
IXMLEntityResolver entityResolver,
boolean external)
throws java.lang.Exception
parseDTD in interface IXMLValidatorpublicID - 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.
java.lang.Exception - if something went wrong.
public void elementStarted(java.lang.String name,
java.lang.String systemId,
int lineNr)
throws java.lang.Exception
elementStarted in interface IXMLValidatorname - 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.
java.lang.Exception - if the element could not be validated.
public void elementEnded(java.lang.String name,
java.lang.String systemId,
int lineNr)
throws java.lang.Exception
elementEnded in interface IXMLValidatorname - 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.
java.lang.Exception - if the element could not be validated.
public void elementAttributesProcessed(java.lang.String name,
java.util.Properties extraAttributes,
java.lang.String systemId,
int lineNr)
throws java.lang.Exception
elementAttributesProcessed in interface IXMLValidatorname - the name of the attribute.extraAttributes - the value of the attribute.systemId - the system ID of the XML data of the element.lineNr - the line number in the XML data of the element.
java.lang.Exception - if the attribute could not be validated.
public void attributeAdded(java.lang.String key,
java.lang.String value,
java.lang.String systemId,
int lineNr)
throws java.lang.Exception
attributeAdded in interface IXMLValidatorkey - the name of the element.value - where to put extra attributes.systemId - the system ID of the XML data of the element.lineNr - the line number in the XML data of the element.
java.lang.Exception - if the element could not be validated.
public void PCDataAdded(java.lang.String systemId,
int lineNr)
throws java.lang.Exception
PCDataAdded in interface IXMLValidatorsystemId - the system ID of the XML data of the element.lineNr - the line number in the XML data of the element.
java.lang.Exception - if the element could not be validated.
public void missingElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String missingElementName)
throws XMLValidationException
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 :-)
public void unexpectedElement(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName,
java.lang.String unexpectedElementName)
throws XMLValidationException
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 :-)
public void missingAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
throws XMLValidationException
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 :-)
public void unexpectedAttribute(java.lang.String systemID,
int lineNr,
java.lang.String elementName,
java.lang.String attributeName)
throws XMLValidationException
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 :-)
public void invalidAttributeValue(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 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 :-)
public void missingPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
throws XMLValidationException
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 :-)
public void unexpectedPCData(java.lang.String systemID,
int lineNr,
java.lang.String parentElementName)
throws XMLValidationException
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 :-)
public 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 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 :-)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||