private static XMLWriter createWriter(Writer w) { // buffering improves the performance DataWriter dw = new DataWriter(new BufferedWriter(w)); dw.setIndentStep(" "); return dw; }
/** * Print indentation for the current level. * * @exception org.xml.sax.SAXException If there is an error * writing the indentation characters, or if a filter * further down the chain raises an exception. */ private void doIndent () throws SAXException { if (depth > 0) { char[] ch = indentStep.toCharArray(); for( int i=0; i<depth; i++ ) characters(ch, 0, ch.length); } }
public void comment(char ch[], int start, int length) throws SAXException { if (depth > 0) { super.characters("\n"); } doIndent(); super.comment(ch,start,length); }
/** * 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 s = new StringBuilder(); for( ; indentStep>0; indentStep-- ) s.append(' '); setIndentStep(s.toString()); }
public void comment(char ch[], int start, int length) throws SAXException { if (depth > 0) { super.characters("\n"); } doIndent(); super.comment(ch,start,length); }
/** * 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 s = new StringBuilder(); for( ; indentStep>0; indentStep-- ) s.append(' '); setIndentStep(s.toString()); }
private static XMLWriter createWriter(Writer w) { // buffering improves the performance DataWriter dw = new DataWriter(new BufferedWriter(w)); dw.setIndentStep(" "); return dw; }
public void comment(char ch[], int start, int length) throws SAXException { if (depth > 0) { super.characters("\n"); } doIndent(); super.comment(ch,start,length); }
/** * Print indentation for the current level. * * @exception org.xml.sax.SAXException If there is an error * writing the indentation characters, or if a filter * further down the chain raises an exception. */ private void doIndent () throws SAXException { if (depth > 0) { char[] ch = indentStep.toCharArray(); for( int i=0; i<depth; i++ ) characters(ch, 0, ch.length); } }
/** * 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 s = new StringBuilder(); for( ; indentStep>0; indentStep-- ) s.append(' '); setIndentStep(s.toString()); }
private static XMLWriter createWriter(Writer w) { // buffering improves the performance DataWriter dw = new DataWriter(new BufferedWriter(w)); dw.setIndentStep(" "); return dw; }
public void comment(char ch[], int start, int length) throws SAXException { if (depth > 0) { super.characters("\n"); } doIndent(); super.comment(ch,start,length); }
/** * Print indentation for the current level. * * @exception org.xml.sax.SAXException If there is an error * writing the indentation characters, or if a filter * further down the chain raises an exception. */ private void doIndent () throws SAXException { if (depth > 0) { char[] ch = indentStep.toCharArray(); for( int i=0; i<depth; i++ ) characters(ch, 0, ch.length); } }
/** * 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 s = new StringBuilder(); for( ; indentStep>0; indentStep-- ) s.append(' '); setIndentStep(s.toString()); }
private static XMLWriter createWriter(Writer w) { // buffering improves the performance DataWriter dw = new DataWriter(new BufferedWriter(w)); dw.setIndentStep(" "); return dw; }
public void comment(char ch[], int start, int length) throws SAXException { if (depth > 0) { super.characters("\n"); } doIndent(); super.comment(ch,start,length); }
/** * Print indentation for the current level. * * @exception org.xml.sax.SAXException If there is an error * writing the indentation characters, or if a filter * further down the chain raises an exception. */ private void doIndent () throws SAXException { if (depth > 0) { char[] ch = indentStep.toCharArray(); for( int i=0; i<depth; i++ ) characters(ch, 0, ch.length); } }
/** * 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 s = new StringBuilder(); for( ; indentStep>0; indentStep-- ) s.append(' '); setIndentStep(s.toString()); }
private static XMLWriter createWriter(Writer w) { // buffering improves the performance DataWriter dw = new DataWriter(new BufferedWriter(w)); dw.setIndentStep(" "); return dw; }
/** * Write an end tag. * * <p>If the element has contained other elements, the tag * will appear indented on a new line; otherwise, it will * appear immediately following whatever came before.</p> * * <p>The newline and indentation will be passed on down * the filter chain through regular characters events.</p> * * @param uri The element's Namespace URI. * @param localName The element's local name. * @param qName The element's qualified (prefixed) name. * @exception org.xml.sax.SAXException If there is an error * writing the end tag, or if a filter further * down the chain raises an exception. * @see XMLWriter#endElement(String, String, String) */ public void endElement (String uri, String localName, String qName) throws SAXException { depth--; if (state == SEEN_ELEMENT) { super.characters("\n"); doIndent(); } super.endElement(uri, localName, qName); state = stateStack.pop(); }