*
* @param element The element that (should be) the CFScript function
* @return The formatted name of the funciton + parameters
*/
private String getCFScriptFunctionName(Object element) {
ASTFunctionDeclaration function = (ASTFunctionDeclaration)element;
CFNodeList children = function.getChildNodes();
StringBuffer nameBuffer = new StringBuffer();
if(children.size() > 0)
{
DocItem firstChild = (DocItem)children.get(0);
if(firstChild instanceof ASTParameterList)
{
CFNodeList params = ((ASTParameterList)firstChild).getChildNodes();
Iterator paramIter = params.iterator();
while(paramIter.hasNext())
{
Object currentParam = paramIter.next();
if(!(currentParam instanceof ASTId))
{
continue;
}
if(nameBuffer.length() > 0)
{
nameBuffer.append(", ");
}
nameBuffer.append(((ASTId)currentParam).toString());
}
}
}
nameBuffer.insert(0, function.getItemData() + "(");
nameBuffer.append(")");
return nameBuffer.toString();
}