private void flushBuffer() throws IOException { for (Text t : buffer) { if (t instanceof Comment) { listener.onComment(t.getText()); } else if (t instanceof Whitespace) { listener.onWhitespace(t.getText()); } } buffer.clear(); }
/** * This will append the content of another <code>Text</code> node to this node. * * @param text Text node to append. */ public void append(Text text) { if (text == null) { return; } value += text.getText(); }