private String getParameterListHTML(Set<Parameter> list) { StringBuilder html = new StringBuilder(); html.append("<table class=\"param-table\">") .append("<thead>") .append("<th class=\"th-name\">Name</th>") .append("<th class=\"th-identifier\">Identifier</th>") .append("<th class=\"th-type\">Type</th>") .append("<th class=\"th-remark\">Remark</th>") .append("</thead>"); getParameterListHTMLSub(html, list, (short) 1); html.append("</table>"); return html.toString(); }
private void getParameterListHTMLSub(StringBuilder html, Set<Parameter> list, short level) { for (Parameter p : list) { html.append("<tr class=\"tr-level-" + level + "\">") .append( "<td class=\"td-name\">" + levelMark(level) + StringUtils.escapeInH(p.getName()) + "</td>") .append( "<td class=\"td-identifier\">" + StringUtils.escapeInH(p.getIdentifier()) + "</td>") .append("<td class=\"td-type\">" + StringUtils.escapeInH(p.getDataType()) + "</td>") .append("<td class=\"td-remark\">" + StringUtils.escapeInH(p.getRemark()) + "</td>") .append("</tr>"); if (p.getParameterList() != null || p.getParameterList().size() > 0) { getParameterListHTMLSub(html, p.getParameterList(), (short) (level + 1)); } } }