Search in sources :

Example 1 with ModelJXPathContext

use of org.openforis.idm.model.expression.internal.ModelJXPathContext in project collect by openforis.

the class AbstractExpression method createJXPathContext.

/**
 * Creates a new JXPath context in order to evaluate the expression
 */
private JXPathContext createJXPathContext(Node<?> contextNode, Node<?> thisNode) {
    ModelJXPathContext jxPathContext = ModelJXPathContext.newContext(this.jxPathContext, contextNode);
    Variables variables = jxPathContext.getVariables();
    variables.declareVariable(CONTEXT_NODE_VARIABLE_NAME, contextNode);
    if (thisNode != null) {
        variables.declareVariable(THIS_VARIABLE_NAME, thisNode);
    }
    return jxPathContext;
}
Also used : Variables(org.apache.commons.jxpath.Variables) ModelJXPathContext(org.openforis.idm.model.expression.internal.ModelJXPathContext)

Aggregations

Variables (org.apache.commons.jxpath.Variables)1 ModelJXPathContext (org.openforis.idm.model.expression.internal.ModelJXPathContext)1