List<String> fParams = Lists.newArrayList();
String calleeName = getCalleeName(callee);
for (FormalParameter parameter : callee.getParameters()) {
String paramName = parameter.getPrimaryName();
if (!Implementable.INSTANCE_PARAM_NAME.equals(paramName)) {
Attribute value = callerAttrs.get(paramName);
String defaultFetchString = (parameter.getType().getDefaultValue() == null)
? calleeName + "." + getDefaultMethodName(parameter) + "()"
: getScalaExpression(parameter.getType().getDefaultValue());
if (value == null) {
fParams.add(defaultFetchString);
} else if (value.getCondition() != null) {
String s = "(" +
getScalaExpression(value.getCondition()) +
" ? " + getScalaExpression(value.getValue()) + " : " +
defaultFetchString + ")";
fParams.add(s);
} else {
fParams.add(getScalaExpression(value.getValue()));
}
}
}
return fParams;
}