Beispiel #1
0
 public String toString(final NamedParameterNode<?> n) {
   final StringBuilder sb =
       new StringBuilder("Name: " + n.getSimpleArgName() + " " + n.getFullName());
   final String[] instances = n.getDefaultInstanceAsStrings();
   if (instances.length != 0) {
     sb.append(" = ");
     sb.append(join(",", instances));
   }
   if (!n.getDocumentation().equals("")) {
     sb.append(" //" + n.getDocumentation());
   }
   return sb.toString();
 }
Beispiel #2
0
  public String toHtmlString(final NamedParameterNode<?> n, final String pack) {
    final String fullName = stripPrefix(n.getFullName(), pack);
    final StringBuffer sb = new StringBuffer();

    sb.append("<div id='" + n.getFullName() + "' class='decl-margin'>");
    sb.append("<div class='decl'>");

    sb.append(cell(n.getSimpleArgName(), "simpleName") + cell(fullName, FULLNAME));
    final String instance;
    final String[] instances = n.getDefaultInstanceAsStrings();
    if (instances.length != 0) {
      final StringBuffer sb2 = new StringBuffer(" = " + stripPrefix(instances[0], pack));
      for (int i = 1; i < instances.length; i++) {
        sb2.append("," + stripPrefix(instances[i], pack));
      }
      instance = sb2.toString();
    } else {
      instance = "";
    }
    sb.append(cell(instance, "instance"));
    final StringBuffer doc = new StringBuffer();
    if (!n.getDocumentation().equals("")) {
      doc.append(n.getDocumentation());
    }
    sb.append(cell(doc, "doc"));
    final StringBuffer uses = new StringBuffer();
    for (final String u : getUsesOf(n)) {
      uses.append("<a href='#" + u + "'>" + stripPrefix(u, pack) + "</a> ");
    }
    sb.append(cell(uses, USES));
    final StringBuffer settersStr = new StringBuffer();
    for (final String f : getSettersOf(n)) {
      settersStr.append("<a href='#" + f + "'>" + stripPrefix(f, pack) + "</a> ");
    }
    sb.append(cell(settersStr, SETTERS));
    sb.append("</div>");
    sb.append("</div>");
    return row(sb);
  }