Examples of XPathMatcher


Examples of mf.org.apache.xerces.impl.xs.identity.XPathMatcher

            // 6 The element information item must be valid with respect to each of the {identity-constraint definitions} as per Identity-constraint Satisfied (3.11.4).
           
            // call matchers and de-activate context
            int oldCount = fMatcherStack.getMatcherCount();
            for (int i = oldCount - 1; i >= 0; i--) {
                XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
                if (fCurrentElemDecl == null) {
                    matcher.endElement(element, fCurrentType, false, fValidatedInfo.actualValue, fValidatedInfo.actualValueType, fValidatedInfo.itemValueTypes);
                }
                else {
                    matcher.endElement(
                            element,
                            fCurrentType,
                            fCurrentElemDecl.getNillable(),
                            fDefaultValue == null
                                ? fValidatedInfo.actualValue
                                : fCurrentElemDecl.fDefault.actualValue,
                            fDefaultValue == null
                                ? fValidatedInfo.actualValueType
                                : fCurrentElemDecl.fDefault.actualValueType,
                            fDefaultValue == null
                                ? fValidatedInfo.itemValueTypes
                                : fCurrentElemDecl.fDefault.itemValueTypes);
                }
            }
           
            if (fMatcherStack.size() > 0) {
                fMatcherStack.popContext();
            }
           
            int newCount = fMatcherStack.getMatcherCount();
            // handle everything *but* keyref's.
            for (int i = oldCount - 1; i >= newCount; i--) {
                XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
                if (matcher instanceof Selector.Matcher) {
                    Selector.Matcher selMatcher = (Selector.Matcher) matcher;
                    IdentityConstraint id;
                    if ((id = selMatcher.getIdentityConstraint()) != null
                            && id.getCategory() != IdentityConstraint.IC_KEYREF) {
                        fValueStoreCache.transplant(id, selMatcher.getInitialDepth());
                    }
                }
            }
           
            // now handle keyref's/...
            for (int i = oldCount - 1; i >= newCount; i--) {
                XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
                if (matcher instanceof Selector.Matcher) {
                    Selector.Matcher selMatcher = (Selector.Matcher) matcher;
                    IdentityConstraint id;
                    if ((id = selMatcher.getIdentityConstraint()) != null
                            && id.getCategory() == IdentityConstraint.IC_KEYREF) {
View Full Code Here

Examples of org.apache.xerces.impl.xpath.XPathMatcher

            // activate the fields, if selector is matched
            if (isMatched()) {
                int count = fIdentityConstraint.getFieldCount();
                for (int i = 0; i < count; i++) {
                    Field field = fIdentityConstraint.getFieldAt(i);
                    XPathMatcher matcher = fFieldActivator.activateField(field);
                    // NOTE: We have to notify the field of *this* element
                    //       to handle fields like "@foo" which is relative
                    //       to the selector matched. -Ac
                    matcher.startElement(element, attributes);
                }
            }
   
        } // startElement(QName,XMLAttributes)
View Full Code Here

Examples of org.apache.xerces.impl.xs.identity.XPathMatcher

     * @param field The field to activate.
     */
    public XPathMatcher activateField(Field field, int initialDepth) {
        ValueStore valueStore = fValueStoreCache.getValueStoreFor(field.getIdentityConstraint(), initialDepth);
        field.setMayMatch(true);
        XPathMatcher matcher = field.createMatcher(valueStore);
        fMatcherStack.addMatcher(matcher);
        matcher.startDocumentFragment(fSymbolTable);
        return matcher;
    } // activateField(Field):XPathMatcher
View Full Code Here

Examples of org.apache.xerces.impl.xs.identity.XPathMatcher

    private void activateSelectorFor(IdentityConstraint ic) throws XNIException {
        Selector selector = ic.getSelector();
        FieldActivator activator = this;
        if (selector == null)
            return;
        XPathMatcher matcher = selector.createMatcher(activator, fElementDepth);
        fMatcherStack.addMatcher(matcher);
        matcher.startDocumentFragment(fSymbolTable);
    }
View Full Code Here

Examples of org.apache.xerces.impl.xs.identity.XPathMatcher

        }

        // call all active identity constraints
        int count = fMatcherStack.getMatcherCount();
        for (int i = 0; i < count; i++) {
            XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
            matcher.startElement(element, attributes, fCurrentElemDecl);
        }

        if (fAugPSVI) {
            augs = getEmptyAugs(augs);
View Full Code Here

Examples of org.apache.xerces.impl.xs.identity.XPathMatcher

        // 6 The element information item must be valid with respect to each of the {identity-constraint definitions} as per Identity-constraint Satisfied (3.11.4).

        // call matchers and de-activate context
        int oldCount = fMatcherStack.getMatcherCount();
        for (int i = oldCount - 1; i >= 0; i--) {
            XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
            matcher.endElement(element, fCurrentElemDecl,
                               fDefaultValue == null ?
                               fValidatedInfo.normalizedValue :
                               fCurrentElemDecl.fDefault.normalizedValue);
        }
        if (fMatcherStack.size() > 0) {
            fMatcherStack.popContext();
        }
        int newCount = fMatcherStack.getMatcherCount();
        // handle everything *but* keyref's.
        for (int i = oldCount - 1; i >= newCount; i--) {
            XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
            if(matcher instanceof Selector.Matcher) {
                Selector.Matcher selMatcher = (Selector.Matcher)matcher;
                IdentityConstraint id;
                if ((id = selMatcher.getIdentityConstraint()) != null && id.getCategory() != IdentityConstraint.IC_KEYREF) {
                    fValueStoreCache.transplant(id, selMatcher.getInitialDepth());
                }
            }
        }
        // now handle keyref's/...
        for (int i = oldCount - 1; i >= newCount; i--) {
            XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
            if(matcher instanceof Selector.Matcher) {
                Selector.Matcher selMatcher = (Selector.Matcher)matcher;
                IdentityConstraint id;
                if ((id = selMatcher.getIdentityConstraint()) != null && id.getCategory() == IdentityConstraint.IC_KEYREF) {
                    ValueStoreBase values = fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth());
View Full Code Here

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

        if (DEBUG_IDENTITY_CONSTRAINTS) {
            System.out.println("<IC>: activateField(\""+field+"\")");
        }
        ValueStore valueStore = fValueStoreCache.getValueStoreFor(field);
        field.setMayMatch(true);
        XPathMatcher matcher = field.createMatcher(valueStore);
        fMatcherStack.addMatcher(matcher);
        matcher.startDocumentFragment(fStringPool);
        return matcher;
    } // activateField(Field):XPathMatcher
View Full Code Here

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

                    fDocumentHandler.characters(chars, offset, length);
                   
                    // call all active identity constraints
                    int count = fMatcherStack.getMatcherCount();
                    for (int i = 0; i < count; i++) {
                        XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
                        if (DEBUG_IDENTITY_CONSTRAINTS) {
                            String text = new String(chars, offset, length);
                            System.out.println("<IC>: "+matcher.toString()+"#characters("+text+")");
                        }
                        matcher.characters(chars, offset, length);
                    }
                }
                fTrailing = (spaces > 1)?true:false;
                fFirstChunk = false;
                return;
            }
        }
    }
     
       fFirstChunk = false;
       fDocumentHandler.characters(chars, offset, length);

       // call all active identity constraints
       int count = fMatcherStack.getMatcherCount();
       for (int i = 0; i < count; i++) {
           XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
           if (DEBUG_IDENTITY_CONSTRAINTS) {
               String text = new String(chars, offset, length);
               System.out.println("<IC>: "+matcher.toString()+"#characters("+text+")");
           }
           matcher.characters(chars, offset, length);
       }
   }
View Full Code Here

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

          char[] chars = new char[text.length()];
          int offset = 0;
          int length = chars.length;
          text.getChars(offset, length, chars, offset);
          for (int i = 0; i < count; i++) {
              XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
              if (DEBUG_IDENTITY_CONSTRAINTS) {
                  System.out.println("<IC>: "+matcher.toString()+"#characters("+text+")");
              }
              matcher.characters(chars, offset, length);
          }
      }
   }
View Full Code Here

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

         fDocumentHandler.characters(chars, offset, length);

         // call all active identity constraints
         int count = fMatcherStack.getMatcherCount();
         for (int i = 0; i < count; i++) {
             XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
             if (DEBUG_IDENTITY_CONSTRAINTS) {
                 String text = new String(chars, offset, length);
                 System.out.println("<IC>: "+matcher.toString()+"#characters("+text+")");
             }
             matcher.characters(chars, offset, length);
         }
      }

   } // processWhitespace(char[],int,int)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.