while (i.hasNext()) {
TagItem currItem = (TagItem) i.next();
String funcName = currItem.getAttributeValue("name", "unnamed");
String funcReturn = currItem.getAttributeValue("returntype", "any");
Function function = new Function(funcName, funcReturn, Byte.parseByte("8"));
// System.out.println(currItem.getItemData());
if (currItem.hasChildren() && currItem.getFirstChild().getName().equals("cfargument")) {
Iterator childNodes = currItem.getChildNodes().iterator();
DocItem childNode;
while (childNodes.hasNext()) {
childNode = (DocItem) childNodes.next();
if (childNode.getName().equals("cfargument")) {
matcher = pattern.matcher(childNode.getItemData());
while (matcher.find()) {
String value = matcher.group(2).replaceAll("'", "").replaceAll("\"", "");
if (matcher.group(1).toLowerCase().equals("name")) {
name = value;
}
if (matcher.group(1).toLowerCase().equals("type")) {
type = value;
}
if (matcher.group(1).toLowerCase().equals("required")) {
required = value;
}
if (matcher.group(1).toLowerCase().equals("default")) {
defaultvalue = value;
}
}
Parameter newParam = new Parameter(name, type, Boolean.valueOf(required), defaultvalue);
name = type = required = defaultvalue = "";
function.addParameter(newParam);
}
}
}
functions.add(function);
}
i = scriptNodes.iterator();
while (i.hasNext()) {
FunctionInfo currItem = (FunctionInfo) i.next();
String funcName = currItem.getFunctionName();
String funcReturn = currItem.getReturnType();
Function function = new Function(funcName, funcReturn, Byte.parseByte("8"));
// System.out.println(currItem.getItemData());
List args = currItem.getParameters();
Iterator j = args.iterator();
while (j.hasNext()) {
Map<String, String> parameterAttribs = (Map) j.next();
name = parameterAttribs.get("name");
type = parameterAttribs.get("type");
required = parameterAttribs.get("required");
defaultvalue = parameterAttribs.get("default");
Parameter newParam = new Parameter(name, type, Boolean.valueOf(required), defaultvalue);
name = type = required = defaultvalue = "";
function.addParameter(newParam);
}
functions.add(function);
}
return functions;
}