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
performIDcheckvariable, the ID/IDREF checking can be either turned on or turned off.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Locatorthis map remembers every IDREF token encountered in this documentthis map remembers every ID token encountered in this documentprotected LocatorDocument Locator that is given by XML reader.protected final NamespaceSupportnamespace prefix to namespace URI resolver.protected booleanset this flag to true to perform ID/IDREF validation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendElement(String namespaceUri, String localName, String qName) voidendPrefixMapping(String prefix) final Locatorprotected voidinit()booleanisNotation(String notationName) booleanisUnparsedEntity(String entityName) voidnotationDecl(String name, String publicId, String systemId) protected abstract voidonDuplicateId(String id) this method is called when a duplicate id value is found.voidonID(org.relaxng.datatype.Datatype dt, StringToken token) this method is called when a type with ID semantics is matched.voidprocessingInstruction(String name, String data) resolveNamespacePrefix(String prefix) voidvoidvoidstartElement(String namespaceUri, String localName, String qName, Attributes atts) voidstartPrefixMapping(String prefix, String uri) voidunparsedEntityDecl(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, waitMethods 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:
setDocumentLocatorin interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler
-
startElement
public void startElement(String namespaceUri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
init
protected void init() -
notationDecl
- Specified by:
notationDeclin interfaceDTDHandler
-
unparsedEntityDecl
- Specified by:
unparsedEntityDeclin interfaceDTDHandler
-
resolveNamespacePrefix
- Specified by:
resolveNamespacePrefixin interfaceorg.relaxng.datatype.ValidationContext
-
isUnparsedEntity
- Specified by:
isUnparsedEntityin interfaceorg.relaxng.datatype.ValidationContext
-
isNotation
- Specified by:
isNotationin interfaceorg.relaxng.datatype.ValidationContext
-
getBaseUri
- Specified by:
getBaseUriin interfaceorg.relaxng.datatype.ValidationContext
-
onDuplicateId
this method is called when a duplicate id value is found. -
onID
Description copied from interface:IDContextProvider2this 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:
onIDin interfaceIDContextProvider2
-