net.n3.nanoxml
Class NonValidator
- java.lang.Object
-
- net.n3.nanoxml.NonValidator
-
- All Implemented Interfaces:
- IXMLValidator
public class NonValidator extends java.lang.Object implements IXMLValidator
NonValidator is a concrete implementation of IXMLValidator which processes the DTD and handles entity definitions. It does not do any validation itself.
-
-
Constructor Summary
Constructors Constructor and Description NonValidator()Creates the "validator".
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidattributeAdded(java.lang.String key, java.lang.String value, java.lang.String systemId, int lineNr)Indicates that an attribute has been added to the current element.voidelementAttributesProcessed(java.lang.String name, java.util.Properties extraAttributes, java.lang.String systemId, int lineNr)This method is called when the attributes of an XML element have been processed.voidelementEnded(java.lang.String name, java.lang.String systemId, int lineNr)Indicates that the current element has ended.voidelementStarted(java.lang.String name, java.lang.String systemId, int lineNr)Indicates that an element has been started.IXMLEntityResolvergetParameterEntityResolver()Returns the parameter entity resolver.voidparseDTD(java.lang.String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, boolean external)Parses the DTD.voidPCDataAdded(java.lang.String systemId, int lineNr)Indicates that a new #PCDATA element has been encountered.voidsetParameterEntityResolver(IXMLEntityResolver resolver)Sets the parameter entity resolver.
-
-
-
Method Detail
-
setParameterEntityResolver
public void setParameterEntityResolver(IXMLEntityResolver resolver)
Sets the parameter entity resolver.- Specified by:
setParameterEntityResolverin interfaceIXMLValidator- Parameters:
resolver- the entity resolver.
-
getParameterEntityResolver
public IXMLEntityResolver getParameterEntityResolver()
Returns the parameter entity resolver.- Specified by:
getParameterEntityResolverin interfaceIXMLValidator- Returns:
- the entity resolver.
-
parseDTD
public void parseDTD(java.lang.String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, boolean external) throws java.lang.ExceptionParses the DTD. The validator object is responsible for reading the full DTD.- Specified by:
parseDTDin interfaceIXMLValidator- Parameters:
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.- Throws:
java.lang.Exception- If something went wrong.
-
elementStarted
public void elementStarted(java.lang.String name, java.lang.String systemId, int lineNr)Indicates that an element has been started.- Specified by:
elementStartedin interfaceIXMLValidator- Parameters:
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.
-
elementEnded
public void elementEnded(java.lang.String name, java.lang.String systemId, int lineNr)Indicates that the current element has ended.- Specified by:
elementEndedin interfaceIXMLValidator- Parameters:
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.
-
elementAttributesProcessed
public void elementAttributesProcessed(java.lang.String name, java.util.Properties extraAttributes, java.lang.String systemId, int lineNr)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.- Specified by:
elementAttributesProcessedin interfaceIXMLValidator- Parameters:
name- the name of the element.extraAttributes- 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.
-
attributeAdded
public void attributeAdded(java.lang.String key, java.lang.String value, java.lang.String systemId, int lineNr)Indicates that an attribute has been added to the current element.- Specified by:
attributeAddedin interfaceIXMLValidator- Parameters:
key- the name of the attribute.value- 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.
-
PCDataAdded
public void PCDataAdded(java.lang.String systemId, int lineNr)Indicates that a new #PCDATA element has been encountered.- Specified by:
PCDataAddedin interfaceIXMLValidator- Parameters:
systemId- the system ID of the XML data of the element.lineNr- the line number in the XML data of the element.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG