325N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * {@link XMLFilterImpl} that does indentation to SAX events. 325N/A * @author Kohsuke Kawaguchi 325N/A * Return the current indent step. 325N/A * <p>Return the current indent step: each start tag will be 325N/A * indented by this number of spaces times the number of 325N/A * ancestors that the element has.</p> 325N/A * @return The number of spaces in each indentation step, 325N/A * or 0 or less for no indentation. 325N/A * @see #setIndentStep(int) 325N/A * Only return the length of the indent string. 325N/A * Set the current indent step. 325N/A * @param indentStep The new indent step (0 or less for no 325N/A * @see #getIndentStep() 325N/A * Should use the version that takes string. 325N/A //////////////////////////////////////////////////////////////////// 325N/A // Override methods from XMLWriter. 325N/A //////////////////////////////////////////////////////////////////// 325N/A * <p>Each tag will begin on a new line, and will be 325N/A * indented by the current indent step times the number 325N/A * of ancestors that the element has.</p> 325N/A * <p>The newline and indentation will be passed on down 325N/A * the filter chain through regular characters events.</p> 325N/A * @param uri The element's Namespace URI. 325N/A * @param localName The element's local name. 325N/A * @param qName The element's qualified (prefixed) name. 325N/A * @param atts The element's attribute list. 325N/A * @exception org.xml.sax.SAXException If there is an error 325N/A * writing the start tag, or if a filter further 325N/A * down the chain raises an exception. 325N/A * @see XMLWriter#startElement(String, String, String,Attributes) 325N/A * <p>If the element has contained other elements, the tag 325N/A * will appear indented on a new line; otherwise, it will 325N/A * appear immediately following whatever came before.</p> 325N/A * <p>The newline and indentation will be passed on down 325N/A * the filter chain through regular characters events.</p> 325N/A * @param uri The element's Namespace URI. 325N/A * @param localName The element's local name. 325N/A * @param qName The element's qualified (prefixed) name. 325N/A * @exception org.xml.sax.SAXException If there is an error 325N/A * writing the end tag, or if a filter further 325N/A * down the chain raises an exception. 325N/A * @see XMLWriter#endElement(String, String, String) 325N/A// * Write a empty element tag. 325N/A// * <p>Each tag will appear on a new line, and will be 325N/A// * indented by the current indent step times the number 325N/A// * of ancestors that the element has.</p> 325N/A// * <p>The newline and indentation will be passed on down 325N/A// * the filter chain through regular characters events.</p> 325N/A// * @param uri The element's Namespace URI. 325N/A// * @param localName The element's local name. 325N/A// * @param qName The element's qualified (prefixed) name. 325N/A// * @param atts The element's attribute list. 325N/A// * @exception org.xml.sax.SAXException If there is an error 325N/A// * writing the empty tag, or if a filter further 325N/A// * down the chain raises an exception. 325N/A// * @see XMLWriter#emptyElement(String, String, String, Attributes) 325N/A// public void emptyElement (String uri, String localName, 325N/A// String qName, Attributes atts) 325N/A// state = SEEN_ELEMENT; 325N/A// super.characters("\n"); 325N/A// super.emptyElement(uri, localName, qName, atts); 325N/A * Write a sequence of characters. 325N/A * @param ch The characters to write. 325N/A * @param start The starting position in the array. 325N/A * @param length The number of characters to use. 325N/A * @exception org.xml.sax.SAXException If there is an error 325N/A * writing the characters, or if a filter further 325N/A * down the chain raises an exception. 325N/A * @see XMLWriter#characters(char[], int, int) 325N/A //////////////////////////////////////////////////////////////////// 325N/A //////////////////////////////////////////////////////////////////// 325N/A * Print indentation for the current level. 325N/A * @exception org.xml.sax.SAXException If there is an error 325N/A * writing the indentation characters, or if a filter 325N/A * further down the chain raises an exception. 325N/A //////////////////////////////////////////////////////////////////// 325N/A //////////////////////////////////////////////////////////////////// 325N/A //////////////////////////////////////////////////////////////////// 325N/A ////////////////////////////////////////////////////////////////////