Ejemplo n.º 1
0
  public static String toMarkup(Example example, boolean prettyPrint, MarkupPrinter printer) {
    StringBuilder sb = new StringBuilder();
    if (example.hasChild()) sb.append(Cells.toMarkup(example.firstChild(), prettyPrint, printer));
    else sb.append(EMPTY);

    if (example.hasSibling()) {
      sb.append("\n");
      sb.append(toMarkup(example.nextSibling(), prettyPrint, printer));
    }
    return sb.toString();
  }
Ejemplo n.º 2
0
  public String interpretedElements() {
    CommentTableFilter ctf = new CommentTableFilter();
    Example tableToFilter = Tables.parse(documentContent);
    StringBuilder ret = new StringBuilder();
    boolean none = true;

    while (tableToFilter != null) {
      if (!ctf.canFilter(tableToFilter)) {
        ret.append(tableToFilter.firstChild().toString());
        tableToFilter = tableToFilter.nextSibling();
        none = false;
      } else {
        tableToFilter = ctf.filter(tableToFilter);
      }
    }

    if (none) {
      return "none";
    }
    return ret.toString();
  }