Package com.sun.msv.verifier
Class AbstractVerifier
java.lang.Object
com.sun.msv.verifier.AbstractVerifier
- All Implemented Interfaces:
IDContextProvider2
,org.relaxng.datatype.ValidationContext
,ContentHandler
,DTDHandler
- Direct Known Subclasses:
Verifier
public abstract class AbstractVerifier
extends Object
implements ContentHandler, DTDHandler, IDContextProvider2
Base implementation for various Verifier implementations.
This implementation provides common service like:
- collecting ID/IDREFs.
- storing Locator.
By setting
performIDcheck
variable, the ID/IDREF checking can be either turned on or turned off.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Locator
this map remembers every IDREF token encountered in this documentthis map remembers every ID token encountered in this documentprotected Locator
Document Locator that is given by XML reader.protected final NamespaceSupport
namespace prefix to namespace URI resolver.protected boolean
set this flag to true to perform ID/IDREF validation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endElement
(String namespaceUri, String localName, String qName) void
endPrefixMapping
(String prefix) final Locator
protected void
init()
boolean
isNotation
(String notationName) boolean
isUnparsedEntity
(String entityName) void
notationDecl
(String name, String publicId, String systemId) protected abstract void
onDuplicateId
(String id) this method is called when a duplicate id value is found.void
onID
(org.relaxng.datatype.Datatype dt, StringToken token) this method is called when a type with ID semantics is matched.void
processingInstruction
(String name, String data) resolveNamespacePrefix
(String prefix) void
void
void
startElement
(String namespaceUri, String localName, String qName, Attributes atts) void
startPrefixMapping
(String prefix, String uri) void
unparsedEntityDecl
(String name, String publicId, String systemId, String notationName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
characters, declaration, endDocument, ignorableWhitespace, startDocument
-
Field Details
-
locator
Document Locator that is given by XML reader. Sometimes it doesn't set the locator, so start with a dummy instance. -
dummyLocator
-
performIDcheck
protected boolean performIDcheckset this flag to true to perform ID/IDREF validation. this value cannot be modified in the middle of the validation. -
ids
this map remembers every ID token encountered in this document -
idrefs
this map remembers every IDREF token encountered in this document -
namespaceSupport
namespace prefix to namespace URI resolver. this object memorizes mapping information.
-
-
Constructor Details
-
AbstractVerifier
public AbstractVerifier()
-
-
Method Details
-
getLocator
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
-
startElement
public void startElement(String namespaceUri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
init
protected void init() -
notationDecl
- Specified by:
notationDecl
in interfaceDTDHandler
-
unparsedEntityDecl
- Specified by:
unparsedEntityDecl
in interfaceDTDHandler
-
resolveNamespacePrefix
- Specified by:
resolveNamespacePrefix
in interfaceorg.relaxng.datatype.ValidationContext
-
isUnparsedEntity
- Specified by:
isUnparsedEntity
in interfaceorg.relaxng.datatype.ValidationContext
-
isNotation
- Specified by:
isNotation
in interfaceorg.relaxng.datatype.ValidationContext
-
getBaseUri
- Specified by:
getBaseUri
in interfaceorg.relaxng.datatype.ValidationContext
-
onDuplicateId
this method is called when a duplicate id value is found. -
onID
Description copied from interface:IDContextProvider2
this method is called when a type with ID semantics is matched. It is the callee's responsibility that stores ID and checks doubly defined ID, if it is necessary.- Specified by:
onID
in interfaceIDContextProvider2
-