@Override protected WtNode before(WtNode node) { p.eatNewlinesAndIndents(2); return super.before(node); }
@Override protected WtNode before(WtNode node) { p.eatNewlinesAndIndents(2); return super.before(node); }
protected void printProperties(AstNode<T> n) { Map<String, Object> props = new TreeMap<String, Object>(); for (Entry<String, Object> entry : n.getAttributes().entrySet()) props.put("{A} " + entry.getKey(), entry.getValue()); AstNodePropertyIterator i = n.propertyIterator(); while (i.next()) { if (i.getValue() != null || !i.getName().equals("rtd")) props.put("{P} " + i.getName(), i.getValue()); } for (Entry<String, Object> entry : props.entrySet()) { p.indent(entry.getKey()); p.print(" = "); p.eatNewlinesAndIndents(1); printPropertyValue(entry.getValue()); p.clearEatNewlinesAndIndents(); } }
protected void printEntityMap(AstEntityMap<T> entityMap) { if (entityMap.getMap().isEmpty()) { p.indentln("-"); } else { Map<Integer, T> map = new TreeMap<Integer, T>(entityMap.getMap()); p.indentln("{"); p.incIndent(); for (Iterator<Entry<Integer, T>> k = map.entrySet().iterator(); k.hasNext();) { Entry<Integer, T> entry = k.next(); p.indent('['); p.print(entry.getKey().toString()); p.print("] = "); p.eatNewlinesAndIndents(1); printPropertyValue(entry.getValue()); p.clearEatNewlinesAndIndents(); p.ignoreNewlines(); p.println(k.hasNext() ? "," : ""); } p.decIndent(); p.indentln('}'); } }
protected void printListOfNodes(AstNode<T> n) { int j = 0; String[] childNames = n.getChildNames(); for (Iterator<T> i = n.iterator(); i.hasNext();) { if (!n.isList()) { p.indent(childNames[j++]); } else { p.indent('['); p.print(String.valueOf(j++)); p.print(']'); } p.print(" = "); p.eatNewlinesAndIndents(1); dispatch(i.next()); p.clearEatNewlinesAndIndents(); p.ignoreNewlines(); p.println(i.hasNext() ? "," : ""); } }
public void visit(WtTableCaption n) { p.clearEatNewlinesAndIndents(); p.capNewlines(1, 1); p.print(" |+"); if (!n.getXmlAttributes().isEmpty()) { dispatch(n.getXmlAttributes()); p.print(" |"); } p.eatNewlinesAndIndents(2); dispatch(n.getBody()); p.capNewlines(1, 1); }
public void visit(WtTableCaption n) { p.clearEatNewlinesAndIndents(); p.capNewlines(1, 1); p.print(" |+"); if (!n.getXmlAttributes().isEmpty()) { dispatch(n.getXmlAttributes()); p.print(" |"); } p.eatNewlinesAndIndents(2); dispatch(n.getBody()); p.capNewlines(1, 1); }
public void visit(WtTableCell n) { p.clearEatNewlinesAndIndents(); p.capNewlines(1, 1); p.print(" |"); if (!n.getXmlAttributes().isEmpty()) { dispatch(n.getXmlAttributes()); p.print(" |"); } p.eatNewlinesAndIndents(2); dispatch(n.getBody()); p.capNewlines(1, 1); }
public void visit(WtTableHeader n) { p.clearEatNewlinesAndIndents(); p.capNewlines(1, 1); p.print(" !"); if (!n.getXmlAttributes().isEmpty()) { dispatch(n.getXmlAttributes()); p.print(" |"); } p.eatNewlinesAndIndents(2); dispatch(n.getBody()); p.capNewlines(1, 1); }
public void visit(WtTableCell n) { p.clearEatNewlinesAndIndents(); p.capNewlines(1, 1); p.print(" |"); if (!n.getXmlAttributes().isEmpty()) { dispatch(n.getXmlAttributes()); p.print(" |"); } p.eatNewlinesAndIndents(2); dispatch(n.getBody()); p.capNewlines(1, 1); }
public void visit(WtTableHeader n) { p.clearEatNewlinesAndIndents(); p.capNewlines(1, 1); p.print(" !"); if (!n.getXmlAttributes().isEmpty()) { dispatch(n.getXmlAttributes()); p.print(" |"); } p.eatNewlinesAndIndents(2); dispatch(n.getBody()); p.capNewlines(1, 1); }