Search in sources :

Example 1 with NodeSetContext

use of org.apache.commons.jxpath.ri.axes.NodeSetContext in project collect by openforis.

the class ModelExtensionFunction method computeValue.

@Override
public Object computeValue(EvalContext context) {
    Object[] parameters = null;
    if (args != null) {
        parameters = new Object[args.length];
        for (int i = 0; i < args.length; i++) {
            Expression expression = args[i];
            Iterator<?> computedValues = expression.iterate(context);
            parameters[i] = convert(computedValues);
        }
    }
    Object result = invoke(context, parameters);
    return result instanceof NodeSet ? new NodeSetContext(context, (NodeSet) result) : result;
}
Also used : NodeSet(org.apache.commons.jxpath.NodeSet) Expression(org.apache.commons.jxpath.ri.compiler.Expression) NodeSetContext(org.apache.commons.jxpath.ri.axes.NodeSetContext)

Aggregations

NodeSet (org.apache.commons.jxpath.NodeSet)1 NodeSetContext (org.apache.commons.jxpath.ri.axes.NodeSetContext)1 Expression (org.apache.commons.jxpath.ri.compiler.Expression)1