Package org.apache.xerces.validators.schema.identity

Examples of org.apache.xerces.validators.schema.identity.IdentityConstraint


        /** Returns the value store associated to the specified field. */
        public ValueStoreBase getValueStoreFor(Field field) {
            if (DEBUG_VALUE_STORES) {
                System.out.println("<VS>: "+toString()+"#getValueStoreFor("+field+")");
            }
            IdentityConstraint identityConstraint = field.getIdentityConstraint();
            return (ValueStoreBase)fIdentityConstraint2ValueStoreMap.get(identityConstraint);
        } // getValueStoreFor(Field):ValueStoreBase
View Full Code Here


        if ( colonptr > 0) {
            prefix = kName.substring(0,colonptr);
            localpart = kName.substring(colonptr+1);
        }
        String uriStr = resolvePrefixToURI(prefix);
        IdentityConstraint kId = (IdentityConstraint)fIdentityConstraintNames.get(uriStr+","+localpart);
        if (kId== null) {
            reportSchemaError(SchemaMessageProvider.KeyRefReferNotFound,
                              new Object[]{krName,kName});
            return;
        }

        String eName = getElementNameFor(krElem);
        KeyRef keyRef = new KeyRef(krName, kId, eName);

        // add to element decl
        traverseIdentityConstraint(keyRef, krElem);
        if(keyRef.getFieldCount() != kId.getFieldCount()){
                 reportSchemaError(SchemaMessageProvider.CardinalityNotEqual, new Object[]{krName,kName});
                 return ;
        }

        // add key reference to element decl
View Full Code Here

            }
            int newCount = fMatcherStack.getMatcherCount();
            // handle everything *but* keyref's.
            for (int i = oldCount - 1; i >= newCount; i--) {
                XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
                IdentityConstraint id;
                if((id = matcher.getIDConstraint()) != null  && id.getType() != IdentityConstraint.KEYREF) {
                    if (DEBUG_IDENTITY_CONSTRAINTS) {
                        System.out.println("<IC>: "+matcher+"#endDocumentFragment()");
                    }
                    matcher.endDocumentFragment();
                    fValueStoreCache.transplant(id);
                } else if (id == null)
                    matcher.endDocumentFragment();
            }
            // now handle keyref's/...
            for (int i = oldCount - 1; i >= newCount; i--) {
                XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
                IdentityConstraint id;
                if((id = matcher.getIDConstraint()) != null && id.getType() == IdentityConstraint.KEYREF) {
                    if (DEBUG_IDENTITY_CONSTRAINTS) {
                        System.out.println("<IC>: "+matcher+"#endDocumentFragment()");
                    }
                    ValueStoreBase values = fValueStoreCache.getValueStoreFor(id);
                    if(values != null) // nothing to do if nothing matched!
View Full Code Here

TOP

Related Classes of org.apache.xerces.validators.schema.identity.IdentityConstraint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.