@Override public void process(final Writer out, final Format format, final Document doc) throws IOException { printDocument(out, new FormatStack(format), new NamespaceStack(), doc); out.flush(); }
@Override public void process(final XMLStreamWriter out, final Format format, final Document doc) throws XMLStreamException { printDocument(out, new FormatStack(format), new NamespaceStack(), doc); out.flush(); }
@Override public void process(final Writer out, final Format format, final Element element) throws IOException { // If this is the root element we could pre-initialize the // namespace stack with the namespaces printElement(out, new FormatStack(format), new NamespaceStack(), element); out.flush(); }
@Override public void process(final XMLStreamWriter out, final Format format, final Element element) throws XMLStreamException { // If this is the root element we could pre-initialize the // namespace stack with the namespaces printElement(out, new FormatStack(format), new NamespaceStack(), element); out.flush(); }
@Override public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final Element element) throws XMLStreamException { // If this is the root element we could pre-initialize the // namespace stack with the namespaces printElement(out, new FormatStack(format), new NamespaceStack(), eventfactory, element); }
@Override public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final Document doc) throws XMLStreamException { printDocument(out, new FormatStack(format), new NamespaceStack(), eventfactory, doc); }
@Override public void process(final XMLStreamWriter out, final Format format, final List<? extends Content> list) throws XMLStreamException { final FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, false); printContent(out, fstack, new NamespaceStack(), walker); out.flush(); }
@Override public org.w3c.dom.Document process(org.w3c.dom.Document basedoc, Format format, Document doc) { return printDocument(new FormatStack(format), new NamespaceStack(), basedoc, doc); }
@Override public org.w3c.dom.Element process(org.w3c.dom.Document basedoc, Format format, Element element) { return printElement(new FormatStack(format), new NamespaceStack(), basedoc, element); }
@Override public void process(final Writer out, final Format format, final List<? extends Content> list) throws IOException { FormatStack fstack = new FormatStack(format); Walker walker = buildWalker(fstack, list, true); printContent(out, fstack, new NamespaceStack(), walker); out.flush(); }
@Override public void process(final Writer out, final Format format, final CDATA cdata) throws IOException { // we use the powers of the Walker to manage text-like content. final List<CDATA> list = Collections.singletonList(cdata); FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, true); if (walker.hasNext()) { printContent(out, fstack, new NamespaceStack(), walker); } out.flush(); }
@Override public void process(final Writer out, final Format format, final Text text) throws IOException { // we use the powers of the Walker to manage text-like content. final List<Text> list = Collections.singletonList(text); FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, true); if (walker.hasNext()) { printContent(out, fstack, new NamespaceStack(), walker); } out.flush(); }
@Override public List<org.w3c.dom.Node> process(org.w3c.dom.Document basedoc, Format format, List<? extends Content> list) { List<org.w3c.dom.Node> ret = new ArrayList<org.w3c.dom.Node>( list.size()); FormatStack fstack = new FormatStack(format); NamespaceStack nstack = new NamespaceStack(); for (Content c : list) { fstack.push(); try { org.w3c.dom.Node node = helperContentDispatcher(fstack, nstack, basedoc, c); if (node != null) { ret.add(node); } } finally { fstack.pop(); } } return ret; }
@Override public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final List<? extends Content> list) throws XMLStreamException { final FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, false); printContent(out, new FormatStack(format), new NamespaceStack(), eventfactory, walker); }
@Override public void process(SAXTarget out, Format format, Text text) throws JDOMException { try { locate(out); final List<Text> list = Collections.singletonList(text); final FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, false); printContent(out, fstack, new NamespaceStack(), walker); } catch (SAXException se) { throw new JDOMException( "Encountered a SAX exception processing the Text: ", se); } }
@Override public void process(SAXTarget out, Format format, Document doc) throws JDOMException { try { locate(out); printDocument(out, new FormatStack(format), new NamespaceStack(), doc); } catch (SAXException se) { throw new JDOMException( "Encountered a SAX exception processing the Document: ", se); } }
@Override public void process(SAXTarget out, Format format, Element element) throws JDOMException { try { locate(out); printElement(out, new FormatStack(format), new NamespaceStack(), element); } catch (SAXException se) { throw new JDOMException( "Encountered a SAX exception processing the Element: ", se); } }
@Override public void process(SAXTarget out, Format format, CDATA cdata) throws JDOMException { try { locate(out); final List<CDATA> list = Collections.singletonList(cdata); final FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, false); printContent(out, fstack, new NamespaceStack(), walker); } catch (SAXException se) { throw new JDOMException( "Encountered a SAX exception processing the CDATA: ", se); } }
@Override public void processAsDocument(SAXTarget out, Format format, Element node) throws JDOMException { try { if (node == null) { return; } locate(out); // contentHandler.setDocumentLocator() out.getContentHandler().startDocument(); printElement(out, new FormatStack(format), new NamespaceStack(), node); // contentHandler.endDocument() out.getContentHandler().endDocument(); } catch (SAXException se) { throw new JDOMException( "Encountered a SAX exception processing the Element: ", se); } }
@Override public void process(SAXTarget out, Format format, List<? extends Content> list) throws JDOMException { try { locate(out); final FormatStack fstack = new FormatStack(format); final Walker walker = buildWalker(fstack, list, false); printContent(out, fstack, new NamespaceStack(), walker); } catch (SAXException se) { throw new JDOMException( "Encountered a SAX exception processing the List: ", se); } }