Example usage for org.apache.commons.jxpath.ri EvalContext next

List of usage examples for org.apache.commons.jxpath.ri EvalContext next

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri EvalContext next.

Prototype

public Object next() 

Source Link

Document

Returns the next node pointer in the context

Usage

From source file:org.openvpms.component.system.common.jxpath.OpenVPMSCoreFunction.java

@Override
protected Object functionSum(EvalContext context) {
    Object v = getArg1().compute(context);
    if (v == null) {
        return ZERO;
    } else if (v instanceof EvalContext) {
        BigDecimal sum = new BigDecimal(0.0);
        EvalContext ctx = (EvalContext) v;
        while (ctx.hasNext()) {
            NodePointer ptr = (NodePointer) ctx.next();
            sum = sum.add(TypeConversionUtil.bigDecimalValue(ptr));
        }//www.j a v  a  2s.c o  m
        return sum;
    }
    throw new JXPathException("Invalid argument type for 'sum': " + v.getClass().getName());
}