1 package org.jbpm.bpel.data.xpath; 2 3 import java.util.List ; 4 5 import org.jaxen.Context; 6 import org.jaxen.Function; 7 import org.jaxen.FunctionCallException; 8 9 16 public class RandomFunction implements Function { 17 18 19 public Object call(Context context, List args) throws FunctionCallException { 20 if (!args.isEmpty()) { 21 throw new FunctionCallException("random() takes no parameters"); 22 } 23 return evaluate(); 24 } 25 26 public static Number evaluate() { 27 return new Double (Math.random()); 28 } 29 } 30 | Popular Tags |