/** * Set the current indent step. * * @param indentStep The new indent step (0 or less for no * indentation). * @see #getIndentStep() * * @deprecated * Should use the version that takes string. */ public void setIndentStep (int indentStep) { StringBuilder buf = new StringBuilder(); for( ; indentStep>0; indentStep-- ) buf.append(' '); setIndentStep(buf.toString()); }
public XmlOutput createWriter( Writer w, String encoding ) { // XMLWriter doesn't do buffering, so do it here if it looks like a good idea if(!(w instanceof BufferedWriter)) w = new BufferedWriter(w); assert toBeFlushed==null; toBeFlushed = w; CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(!isFragment()); xw.setHeader(header); return new SAXOutput(xw); // TODO: don't we need a better writer? }
/** * Set the current indent step. * * @param indentStep The new indent step (0 or less for no * indentation). * @see #getIndentStep() * * @deprecated * Should use the version that takes string. */ public void setIndentStep (int indentStep) { StringBuilder buf = new StringBuilder(); for( ; indentStep>0; indentStep-- ) buf.append(' '); setIndentStep(buf.toString()); }
public XmlOutput createWriter( Writer w, String encoding ) { // XMLWriter doesn't do buffering, so do it here if it looks like a good idea if(!(w instanceof BufferedWriter)) w = new BufferedWriter(w); assert toBeFlushed==null; toBeFlushed = w; CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(!isFragment()); xw.setHeader(header); return new SAXOutput(xw); // TODO: don't we need a better writer? }
/** * Set the current indent step. * * @param indentStep The new indent step (0 or less for no * indentation). * @see #getIndentStep() * * @deprecated * Should use the version that takes string. */ public void setIndentStep (int indentStep) { StringBuilder buf = new StringBuilder(); for( ; indentStep>0; indentStep-- ) buf.append(' '); setIndentStep(buf.toString()); }
/** * Set the current indent step. * * @param indentStep The new indent step (0 or less for no * indentation). * @see #getIndentStep() * * @deprecated * Should use the version that takes string. */ public void setIndentStep (int indentStep) { StringBuilder buf = new StringBuilder(); for( ; indentStep>0; indentStep-- ) buf.append(' '); setIndentStep(buf.toString()); }
/** * Set the current indent step. * * @param indentStep The new indent step (0 or less for no * indentation). * @see #getIndentStep() * * @deprecated * Should use the version that takes string. */ public void setIndentStep (int indentStep) { StringBuilder buf = new StringBuilder(); for( ; indentStep>0; indentStep-- ) buf.append(' '); setIndentStep(buf.toString()); }
/** * Set the current indent step. * * @param indentStep The new indent step (0 or less for no * indentation). * @see #getIndentStep() * * @deprecated * Should use the version that takes string. */ public void setIndentStep (int indentStep) { StringBuilder buf = new StringBuilder(); for( ; indentStep>0; indentStep-- ) buf.append(' '); setIndentStep(buf.toString()); }
/** * Dumps the contents of the forest to the specified stream. * * This is a debug method. As such, error handling is sloppy. */ public void dump( OutputStream out ) throws IOException { try { // create identity transformer Transformer it = TransformerFactory.newInstance().newTransformer(); for (Map.Entry<String, Document> e : core.entrySet()) { out.write( ("---<< "+e.getKey()+'\n').getBytes() ); DataWriter dw = new DataWriter(new OutputStreamWriter(out),null); dw.setIndentStep(" "); it.transform( new DOMSource(e.getValue()), new SAXResult(dw)); out.write( "\n\n\n".getBytes() ); } } catch( TransformerException e ) { e.printStackTrace(); } } }
/** * Dumps the contents of the forest to the specified stream. * <p/> * This is a debug method. As such, error handling is sloppy. */ public void dump(OutputStream out) throws IOException { try { // create identity transformer // secure xml processing can be switched off if input requires it boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity; TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); Transformer it = tf.newTransformer(); for (Map.Entry<String, Document> e : core.entrySet()) { out.write(("---<< " + e.getKey() + '\n').getBytes()); DataWriter dw = new DataWriter(new OutputStreamWriter(out), null); dw.setIndentStep(" "); it.transform(new DOMSource(e.getValue()), new SAXResult(dw)); out.write("\n\n\n".getBytes()); } } catch (TransformerException e) { e.printStackTrace(); } }
/** * Dumps the contents of the forest to the specified stream. * * This is a debug method. As such, error handling is sloppy. */ public void dump( OutputStream out ) throws IOException { try { // create identity transformer Transformer it = TransformerFactory.newInstance().newTransformer(); for (Map.Entry<String, Document> e : core.entrySet()) { out.write( ("---<< "+e.getKey()+'\n').getBytes() ); DataWriter dw = new DataWriter(new OutputStreamWriter(out),null); dw.setIndentStep(" "); it.transform( new DOMSource(e.getValue()), new SAXResult(dw)); out.write( "\n\n\n".getBytes() ); } } catch( TransformerException e ) { e.printStackTrace(); } } }
/** * Dumps the contents of the forest to the specified stream. * <p/> * This is a debug method. As such, error handling is sloppy. */ public void dump(OutputStream out) throws IOException { try { // create identity transformer // secure xml processing can be switched off if input requires it boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity; TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); Transformer it = tf.newTransformer(); for (Map.Entry<String, Document> e : core.entrySet()) { out.write(("---<< " + e.getKey() + '\n').getBytes()); DataWriter dw = new DataWriter(new OutputStreamWriter(out), null); dw.setIndentStep(" "); it.transform(new DOMSource(e.getValue()), new SAXResult(dw)); out.write("\n\n\n".getBytes()); } } catch (TransformerException e) { e.printStackTrace(); } }
/** * Dumps the contents of the forest to the specified stream. * <p/> * This is a debug method. As such, error handling is sloppy. */ public void dump(OutputStream out) throws IOException { try { // create identity transformer // secure xml processing can be switched off if input requires it boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity; TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); Transformer it = tf.newTransformer(); for (Map.Entry<String, Document> e : core.entrySet()) { out.write(("---<< " + e.getKey() + '\n').getBytes()); DataWriter dw = new DataWriter(new OutputStreamWriter(out), null); dw.setIndentStep(" "); it.transform(new DOMSource(e.getValue()), new SAXResult(dw)); out.write("\n\n\n".getBytes()); } } catch (TransformerException e) { e.printStackTrace(); } }
public XMLWriter createWriter( Writer w, String encoding ) throws JAXBException { CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); return d; } else return new XMLWriter(w,encoding,ceh); }
public XMLWriter createWriter( Writer w, String encoding ) throws JAXBException { // buffering improves the performance w = new BufferedWriter(w); CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(printXmlDeclaration); xw.setHeader(header); return xw; }
public XMLWriter createWriter( Writer w, String encoding ) throws JAXBException { // buffering improves the performance w = new BufferedWriter(w); CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(printXmlDeclaration); xw.setHeader(header); return xw; }
public XMLWriter createWriter( Writer w, String encoding ) throws JAXBException { // buffering improves the performance w = new BufferedWriter(w); CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(printXmlDeclaration); xw.setHeader(header); return xw; }
public XMLWriter createWriter( Writer w, String encoding ) throws JAXBException { // buffering improves the performance w = new BufferedWriter(w); CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(printXmlDeclaration); xw.setHeader(header); return xw; }
public XmlOutput createWriter( Writer w, String encoding ) { // XMLWriter doesn't do buffering, so do it here if it looks like a good idea if(!(w instanceof BufferedWriter)) w = new BufferedWriter(w); assert toBeFlushed==null; toBeFlushed = w; CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(!isFragment()); xw.setHeader(header); return new SAXOutput(xw); // TODO: don't we need a better writer? }
public XmlOutput createWriter( Writer w, String encoding ) { // XMLWriter doesn't do buffering, so do it here if it looks like a good idea if(!(w instanceof BufferedWriter)) w = new BufferedWriter(w); assert toBeFlushed==null; toBeFlushed = w; CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(!isFragment()); xw.setHeader(header); return new SAXOutput(xw); // TODO: don't we need a better writer? }