Class IDConstraintChecker
java.lang.Object
com.sun.msv.verifier.AbstractVerifier
com.sun.msv.verifier.Verifier
com.sun.msv.verifier.identity.IDConstraintChecker
- All Implemented Interfaces:
IDContextProvider2, IVerifier, org.iso_relax.verifier.VerifierHandler, org.relaxng.datatype.ValidationContext, ContentHandler, DTDHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Mapa map fromIdentityConstraintto aLightStackofSelectorMatcher.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final XMLSchemaGrammarthe grammar object against which we are validating.private final Mapa map fromSelectorMatcherto set ofKeyValues.protected final Vectoractive mathcers.private final Mapa map from keyrefSelectorMatcherto key/uniqueSelectorMatcher.Fields inherited from class Verifier
current, docDecl, ERR_DUPLICATE_ID, ERR_MISSING_ATTRIBUTE, ERR_UNCOMPLETED_CONTENT, ERR_UNEXPECTED_ATTRIBUTE, ERR_UNEXPECTED_ELEMENT, ERR_UNEXPECTED_STARTTAG, ERR_UNEXPECTED_TEXT, ERR_UNSOLD_IDREF, errorHandler, hadError, panicLevelFields inherited from class AbstractVerifier
dummyLocator, idrefs, ids, locator, namespaceSupport, performIDcheck -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected booleanaddKeyValue(SelectorMatcher scope, KeyValue value) adds a new KeyValue to the value set.voidcharacters(char[] buf, int start, int len) voidvoidendElement(String namespaceUri, String localName, String qName) protected org.relaxng.datatype.Datatype[]protected SelectorMatcherprotected KeyValue[]getKeyValues(SelectorMatcher scope) gets the allKeyValues that were added within the specified scope.static StringlocalizeMessage(String propertyName, Object arg) static StringlocalizeMessage(String propertyName, Object[] args) protected voidonNextAcceptorReady(StartTagInfo sti, Acceptor next) this method is called from the startElement method after the tag name is processed and the child acceptor is created.protected voidpopActiveScope(IdentityConstraint c, SelectorMatcher matcher) protected voidpushActiveScope(IdentityConstraint c, SelectorMatcher matcher) protected voidprotected voidreportError(ErrorInfo ei, String propKey, Object[] args) reports an error.protected voidreportError(Locator loc, ErrorInfo ei, String propKey, Object[] args) voidMethods inherited from class Verifier
getCurrentElementType, getErrorHandler, getLastCharacterType, ignorableWhitespace, init, isValid, onDuplicateId, onError, onError, setErrorHandler, setPanicMode, startElement, verifyTextMethods inherited from class AbstractVerifier
endPrefixMapping, getBaseUri, getLocator, isNotation, isUnparsedEntity, notationDecl, onID, processingInstruction, resolveNamespacePrefix, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDeclMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentHandler
endPrefixMapping, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMappingMethods inherited from interface IVerifier
getLocator
-
Field Details
-
grammar
the grammar object against which we are validating. -
matchers
active mathcers. -
keyValues
a map fromSelectorMatcherto set ofKeyValues. One SelectorMatcher correponds to one scope of the identity constraint. -
referenceScope
a map from keyrefSelectorMatcherto key/uniqueSelectorMatcher. Given a keyref scope, this map stores which key scope should it refer to. -
activeScopes
a map fromIdentityConstraintto aLightStackofSelectorMatcher. Each stack top keeps the currently active scope for the given IdentityConstraint. -
ERR_UNMATCHED_KEY_FIELD
- See Also:
-
ERR_NOT_UNIQUE
- See Also:
-
ERR_NOT_UNIQUE_DIAG
- See Also:
-
ERR_DOUBLE_MATCH
- See Also:
-
ERR_UNDEFINED_KEY
- See Also:
-
-
Constructor Details
-
IDConstraintChecker
-
-
Method Details
-
add
-
remove
-
getActiveScope
-
pushActiveScope
-
popActiveScope
-
addKeyValue
adds a new KeyValue to the value set.- Returns:
- true if this is a new value.
-
getKeyValues
gets the allKeyValues that were added within the specified scope. -
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classVerifier- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classVerifier- Throws:
SAXException
-
onNextAcceptorReady
Description copied from class:Verifierthis method is called from the startElement method after the tag name is processed and the child acceptor is created.This method is called before the attributes are consumed.
derived class can use this method to do something useful.
- Overrides:
onNextAcceptorReadyin classVerifier- Throws:
SAXException
-
feedAttribute
protected org.relaxng.datatype.Datatype[] feedAttribute(Acceptor child, String uri, String localName, String qName, String value) throws SAXException - Overrides:
feedAttributein classVerifier- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classVerifier- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classVerifier- Throws:
SAXException
-
reportError
reports an error.- Throws:
SAXException
-
reportError
protected void reportError(Locator loc, ErrorInfo ei, String propKey, Object[] args) throws SAXException - Throws:
SAXException
-
localizeMessage
-
localizeMessage
-