Package org.milyn.cdr.xpath.evaluators

Examples of org.milyn.cdr.xpath.evaluators.XPathExpressionEvaluator


    }

    private void addEvaluators(Step step, PredicatesEvaluator evaluator) throws SAXPathException {
        List<Predicate> predicates = step.getPredicates();
        for (Predicate predicate : predicates) {
            XPathExpressionEvaluator predicateEvaluator = XPathExpressionEvaluator.getInstance(predicate.getExpr(), selectorStep, namespaces);
            evaluator.addEvaluator(predicateEvaluator);
        }
    }
View Full Code Here


            SelectorStep parentStep = selectorSteps[index.i - 1];

            if(parentStep.isTargetedAtElement(parentElement)) {
                if(!parentStep.isStarStar()) {
                    XPathExpressionEvaluator evaluator = parentStep.getPredicatesEvaluator();
                    if(evaluator == null) {
                        logger.debug("Predicate Evaluators for resource [" + this + "] is null.  XPath step predicates will not be evaluated.");
                    } else if(!evaluator.evaluate(parentElement, index.executionContext)) {
                        return false;
                    }
                }
                index.i--;
            }
        } else if (!selectorSteps[index.i].isTargetedAtElement(element)) {
            return false;
        } else {
            if(!selectorSteps[index.i].isStarStar()) {
                XPathExpressionEvaluator evaluator = selectorSteps[index.i].getPredicatesEvaluator();
                if(evaluator == null) {
                    logger.debug("Predicate Evaluators for resource [" + this + "] is null.  XPath step predicates will not be evaluated.");
                } else if(!evaluator.evaluate(element, index.executionContext)) {
                    return false;
                }
            }
            index.i--;
        }
View Full Code Here

            SelectorStep parentStep = selectorSteps[index.i - 1];

            if(parentStep.isTargetedAtElement(parentElement)) {
                if(!parentStep.isStarStar()) {
                    XPathExpressionEvaluator evaluator = parentStep.getPredicatesEvaluator();
                    if(evaluator == null) {
                        logger.debug("Predicate Evaluators for resource [" + this + "] is null.  XPath step predicates will not be evaluated.");
                    } else if(!evaluator.evaluate(parentElement, index.executionContext)) {
                        return false;
                    }
                }
                index.i--;
            }
        } else if (!selectorSteps[index.i].isTargetedAtElement(element)) {
            return false;
        } else {
            if(!selectorSteps[index.i].isStarStar()) {
                XPathExpressionEvaluator evaluator = selectorSteps[index.i].getPredicatesEvaluator();
                if(evaluator == null) {
                    logger.debug("Predicate Evaluators for resource [" + this + "] is null.  XPath step predicates will not be evaluated.");
                } else if(!evaluator.evaluate(element, index.executionContext)) {
                    return false;
                }
            }
            index.i--;
        }
View Full Code Here

                }
                return false;
            }
        }

        XPathExpressionEvaluator evaluator = selectorStep.getPredicatesEvaluator();
        if(evaluator == null) {
            logger.debug("Predicate Evaluators for resource [" + this + "] is null.  XPath step predicates will not be evaluated.");
        } else if(!evaluator.evaluate(element, executionContext)) {
            return false;
        }

        if (isContextualSelector && !isTargetedAtElementContext(element, executionContext)) {
            // Note: If the selector is not contextual, there's no need to perform the
View Full Code Here

                }
                return false;
            }
        }

        XPathExpressionEvaluator evaluator = selectorStep.getPredicatesEvaluator();
        if(evaluator == null) {
            logger.debug("Predicate Evaluators for resource [" + this + "] is null.  XPath step predicates will not be evaluated.");
        } else if(!evaluator.evaluate(element, executionContext)) {
            return false;
        }

        if (isContextualSelector && !isTargetedAtElementContext(element, executionContext)) {
            // Note: If the selector is not contextual, there's no need to perform the
View Full Code Here

     * Does this step include a 'text()' predicate at any level.
     *
     * @return True if the step requires access to the element's text content, otherwise false.
     */
    public boolean accessesText() {
        XPathExpressionEvaluator evaluator = getPredicatesEvaluator();

        if(evaluator == null) {
            return false;
        }

View Full Code Here

        stringBuilder.append(getTargetElement());
        if(targetAttribute != null) {
            stringBuilder.append("{@" + targetAttribute + "}");
        }

        XPathExpressionEvaluator evaluator = getPredicatesEvaluator();
        if(evaluator != null) {
            stringBuilder.append(evaluator);
        }

        return stringBuilder.toString();
View Full Code Here

TOP

Related Classes of org.milyn.cdr.xpath.evaluators.XPathExpressionEvaluator

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.