}
return null;
}
private static Function createFunction(String name, NodeList params) {
Function f = FunctionFactory.createFunction(name);
ArrayList<Object> paramObjects = new ArrayList<Object>();
for(int i = 0; i < params.getLength(); i++) {
org.w3c.dom.Node paramNode = params.item(i);
if(paramNode.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
Element param = (Element)paramNode;
String pname = param.getAttribute("name");
String ptype =param.getAttribute("type");
if(ptype==null || ptype.equals("")) {
Function fx = new StaticValueFunction();
fx.init(param.getTextContent());
paramObjects.add(fx);
} else {
Function fx = createFunction(ptype,param.getChildNodes());
paramObjects.add(fx);
}
}
}
f.init(paramObjects.toArray());