Example usage for org.apache.commons.jxpath.ri.compiler Step getPredicates

List of usage examples for org.apache.commons.jxpath.ri.compiler Step getPredicates

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri.compiler Step getPredicates.

Prototype

public Expression[] getPredicates() 

Source Link

Document

Get the predicates.

Usage

From source file:org.chiba.xml.xpath.impl.JXPathReferenceFinderImpl.java

private void addStepReferences(Map references, Expression context, Step[] steps) {
    Path path;/* ww w  . j a  v  a 2  s  .  c o  m*/
    Step step;
    Step tmp;
    Expression[] predicates;

    for (int i = 0; steps != null && i < steps.length; i++) {
        step = steps[i];
        predicates = step.getPredicates();

        if (predicates != null && predicates.length > 0) {
            // create path without current predicates as context
            tmp = step;
            steps[i] = (Step) this.compiler.step(step.getAxis(), step.getNodeTest(), null);
            path = addSteps(context, steps, i + 1);
            steps[i] = tmp;

            // add references in step predicates
            for (int j = 0; j < predicates.length; j++) {
                addExpressionReferences(references, path, predicates[j]);
            }
        }
    }
}

From source file:org.xchain.framework.jxpath.JXPathValidator.java

static void validateStep(Step step, NamespaceContext xmlns) {
    validateNodeTest(step.getNodeTest(), xmlns);

    for (Expression predicate : step.getPredicates()) {
        validateExpression(predicate, xmlns);
    }/*from w  w  w .jav  a 2 s .c o m*/
}