* @param methodName name of the method.
* @return A String with the class names edited to reflect the imports.
*/
public String getMethodString(Imports imports, Descriptor desc, String className, String methodName) {
StringBuffer sb = new StringBuffer();
JavaType ret = desc.getReturn();
if (ret.isPrimitive()) {
sb.append(ret);
} else {
sb.append(imports.getShortName(ret.getType()));
sb.append(ret.getDimensions());
}
sb.append(" ");
sb.append(imports.getShortName(className));
sb.append(".");
sb.append(methodName);
sb.append("(");
List al = desc.getParamList();
for (int i = 0; i < al.size(); i++) {
JavaType jt = (JavaType) al.get(i);
if (i > 0) sb.append(", ");
if (jt.isPrimitive()) {
sb.append(jt.toString());
} else {
sb.append(imports.getShortName(jt.getType()));
sb.append(jt.getDimensions());
}
}
sb.append(")");
return sb.toString();
}