}
return super.getDocumentation(o);
}
private String getDocumentation(Method m) {
ActionDoc actionDoc = m.getAnnotation(ActionDoc.class);
if(actionDoc!=null) {
StringBuilder sb = new StringBuilder();
sb.append("<p> " + actionDoc.text() + "</p>");
if(m.getParameterTypes().length > 0) {
sb.append("<p><b>Parameters:</b><br>");
List<String> params = new ArrayList<String>();
for(int i = 0; i< m.getParameterTypes().length; i++) {
ParamDoc paramDoc = getParamDoc(m, i);
String paramName = paramDoc!=null ? paramDoc.name() : "p" + i;
params.add(" " + paramName + (StringUtils.isEmpty(paramDoc.text()) ? "" : ": " + paramDoc.text()));
}
sb.append(StringUtils.join(params, "<br/>"));
sb.append("</p>");
}
if(!StringUtils.isEmpty(actionDoc.returns())) {
sb.append("<p><b>Returns:</b><br>");
sb.append(" " + actionDoc.returns() + "<p>");
}
return sb.toString();
}
return null;
}