/** * The constructor. The instance will be reusabe if building a full * document and not reusable if building a fragment. * * @param fragment whether this <code>TreeBuilder</code> should build * a <code>DocumentFragment</code> instead of a <code>Document</code>. * @param retainAttributes whether instances of the <code>Attributes</code> * interface passed to <code>startElement</code> should be retained * (the alternative is copying). */ public TreeBuilder(boolean fragment, boolean retainAttributes) { if (fragment) { current = new DocumentFragment(); } this.retainAttributes = retainAttributes; }
/** * The constructor. The instance will be reusabe if building a full * document and not reusable if building a fragment. * * @param fragment whether this <code>TreeBuilder</code> should build * a <code>DocumentFragment</code> instead of a <code>Document</code>. * @param retainAttributes whether instances of the <code>Attributes</code> * interface passed to <code>startElement</code> should be retained * (the alternative is copying). */ public TreeBuilder(boolean fragment, boolean retainAttributes) { if (fragment) { current = new DocumentFragment(); } this.retainAttributes = retainAttributes; }
/** * The constructor. The instance will be reusabe if building a full * document and not reusable if building a fragment. * * @param fragment whether this <code>TreeBuilder</code> should build * a <code>DocumentFragment</code> instead of a <code>Document</code>. * @param retainAttributes whether instances of the <code>Attributes</code> * interface passed to <code>startElement</code> should be retained * (the alternative is copying). */ public TreeBuilder(boolean fragment, boolean retainAttributes) { if (fragment) { current = new DocumentFragment(); } this.retainAttributes = retainAttributes; }
DocumentFragment getDocumentFragment() { DocumentFragment rv = new DocumentFragment(); rv.appendChildren(document.getFirstChild()); document = null; return rv; }
DocumentFragment getDocumentFragment() { DocumentFragment rv = new DocumentFragment(); rv.appendChildren(document.getFirstChild()); document = null; return rv; }
DocumentFragment getDocumentFragment() { DocumentFragment rv = new DocumentFragment(); rv.appendChildren(document.getFirstChild()); document = null; return rv; }