{
if (_type instanceof CompilableFunction) {
CompilableFunction function = (CompilableFunction)_type;
int max = function.getParameterCount();
int min = function.getMinimumParameterCount();
Array list = new Array();
Any value;
int count = 0;
boolean required;
Doc doc;
for(int i=0; i<max; i++) {
switch(function.getParameterType(i)) {
case CompilableFunction.PARAMETER_CONTEXT:
break;
case CompilableFunction.PARAMETER_ANY:
case CompilableFunction.PARAMETER_STRING:
case CompilableFunction.PARAMETER_OBJECT:
case CompilableFunction.PARAMETER_DOUBLE:
case CompilableFunction.PARAMETER_INT:
case CompilableFunction.PARAMETER_LONG:
case CompilableFunction.PARAMETER_BOOLEAN:
required = (count < min);
if (count >= min) {
value = function.getParameterDefault(i);
if (value == null) {
value = UNDEFINED;
}
} else {
value = UNDEFINED;
}
doc = function.getParameterDoc(i);
list.append(new AnyString(function.getParameterName(i)),
new AnyTuple(new Any[] {
required ? Any.TRUE : Any.FALSE,
value,
Any.create((doc != null) ? doc.getText() : null),
Any.create((doc != null) ? doc.getChildText(doc.T_TYPE, null) : null)
}));
count++;
break;
case CompilableFunction.PARAMETER_ARRAY:
case CompilableFunction.PARAMETER_ANYLIST:
case CompilableFunction.PARAMETER_LIST:
doc = function.getParameterDoc(i);
list.append(DOTDOT, new AnyTuple(new Any[] {
new AnyString(function.getParameterName(i)),
Any.create((doc != null) ? doc.getText() : null),
Any.create((doc != null) ? doc.getChildText(doc.T_TYPE, null) : null)
}));
break;