286N/A * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. 286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 286N/A * This code is free software; you can redistribute it and/or modify it 286N/A * under the terms of the GNU General Public License version 2 only, as 286N/A * published by the Free Software Foundation. Oracle designates this 286N/A * particular file as subject to the "Classpath" exception as provided 286N/A * by Oracle in the LICENSE file that accompanied this code. 286N/A * This code is distributed in the hope that it will be useful, but WITHOUT 286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 286N/A * version 2 for more details (a copy is included in the LICENSE file that 286N/A * accompanied this code). 286N/A * You should have received a copy of the GNU General Public License version 286N/A * 2 along with this work; if not, write to the Free Software Foundation, 286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 286N/A * or visit www.oracle.com if you need additional information or have any 286N/A// Written by David Megginson 286N/A// NO WARRANTY! This class is in the public domain. 286N/A * Default base class for SAX2 event handlers. 286N/A * <em>This module, both source code and documentation, is in the 286N/A * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> 286N/A * for further information. 286N/A * <p>This class is available as a convenience base class for SAX2 286N/A * applications: it provides default implementations for all of the 286N/A * callbacks in the four core SAX2 handler classes:</p> 286N/A * <li>{@link org.xml.sax.EntityResolver EntityResolver}</li> 286N/A * <li>{@link org.xml.sax.ContentHandler ContentHandler}</li> 286N/A * <p>Application writers can extend this class when they need to 286N/A * implement only part of an interface; parser writers can 286N/A * instantiate this class to provide default handlers when the 286N/A * application has not supplied its own.</p> 286N/A * <p>This class replaces the deprecated SAX1 286N/A * @author David Megginson, 286N/A //////////////////////////////////////////////////////////////////// 286N/A // Default implementation of the EntityResolver interface. 286N/A //////////////////////////////////////////////////////////////////// 286N/A * Resolve an external entity. 286N/A * <p>Always return null, so that the parser will use the system 286N/A * identifier provided in the XML document. This method implements 286N/A * the SAX default behaviour: application writers can override it 286N/A * in a subclass to do special translations such as catalog lookups 286N/A * or URI redirection.</p> 286N/A * @param publicId The public identifier, or null if none is 286N/A * @param systemId The system identifier provided in the XML 286N/A * @return The new input source, or null to require the 286N/A * @exception java.io.IOException If there is an error setting 286N/A * up the new input source. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A //////////////////////////////////////////////////////////////////// 286N/A // Default implementation of DTDHandler interface. 286N/A //////////////////////////////////////////////////////////////////// 286N/A * Receive notification of a notation declaration. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass if they wish to keep track of the notations 286N/A * declared in a document.</p> 286N/A * @param name The notation name. 286N/A * @param publicId The notation public identifier, or null if not 286N/A * @param systemId The notation system identifier. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of an unparsed entity declaration. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to keep track of the unparsed entities 286N/A * declared in a document.</p> 286N/A * @param name The entity name. 286N/A * @param publicId The entity public identifier, or null if not 286N/A * @param systemId The entity system identifier. 286N/A * @param notationName The name of the associated notation. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A //////////////////////////////////////////////////////////////////// 286N/A // Default implementation of ContentHandler interface. 286N/A //////////////////////////////////////////////////////////////////// 286N/A * Receive a Locator object for document events. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass if they wish to store the locator for use 286N/A * with other document events.</p> 286N/A * @param locator A locator for all SAX document events. 286N/A * Receive notification of the beginning of the document. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions at the beginning 286N/A * of a document (such as allocating the root node of a tree or 286N/A * creating an output file).</p> 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of the end of the document. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions at the end 286N/A * of a document (such as finalising a tree or closing an output 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of the start of a Namespace mapping. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions at the start of 286N/A * each Namespace prefix scope (such as storing the prefix mapping).</p> 286N/A * @param prefix The Namespace prefix being declared. 286N/A * @param uri The Namespace URI mapped to the prefix. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of the end of a Namespace mapping. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions at the end of 286N/A * each prefix mapping.</p> 286N/A * @param prefix The Namespace prefix being declared. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of the start of an element. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions at the start of 286N/A * each element (such as allocating a new tree node or writing 286N/A * output to a file).</p> 286N/A * @param uri The Namespace URI, or the empty string if the 286N/A * element has no Namespace URI or if Namespace 286N/A * processing is not being performed. 286N/A * @param localName The local name (without prefix), or the 286N/A * empty string if Namespace processing is not being 286N/A * @param qName The qualified name (with prefix), or the 286N/A * empty string if qualified names are not available. 286N/A * @param attributes The attributes attached to the element. If 286N/A * there are no attributes, it shall be an empty 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of the end of an element. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions at the end of 286N/A * each element (such as finalising a tree node or writing 286N/A * output to a file).</p> 286N/A * @param uri The Namespace URI, or the empty string if the 286N/A * element has no Namespace URI or if Namespace 286N/A * processing is not being performed. 286N/A * @param localName The local name (without prefix), or the 286N/A * empty string if Namespace processing is not being 286N/A * @param qName The qualified name (with prefix), or the 286N/A * empty string if qualified names are not available. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of character data inside an element. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method to take specific actions for each chunk of character data 286N/A * (such as adding the data to a node or buffer, or printing it to 286N/A * @param ch The characters. 286N/A * @param start The start position in the character array. 286N/A * @param length The number of characters to use from the 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of ignorable whitespace in element content. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method to take specific actions for each chunk of ignorable 286N/A * whitespace (such as adding data to a node or buffer, or printing 286N/A * @param ch The whitespace characters. 286N/A * @param start The start position in the character array. 286N/A * @param length The number of characters to use from the 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of a processing instruction. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions for each 286N/A * processing instruction, such as setting status variables or 286N/A * invoking other methods.</p> 286N/A * @param target The processing instruction target. 286N/A * @param data The processing instruction data, or null if 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of a skipped entity. 286N/A * <p>By default, do nothing. Application writers may override this 286N/A * method in a subclass to take specific actions for each 286N/A * processing instruction, such as setting status variables or 286N/A * invoking other methods.</p> 286N/A * @param name The name of the skipped entity. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A //////////////////////////////////////////////////////////////////// 286N/A // Default implementation of the ErrorHandler interface. 286N/A //////////////////////////////////////////////////////////////////// 286N/A * Receive notification of a parser warning. 286N/A * <p>The default implementation does nothing. Application writers 286N/A * may override this method in a subclass to take specific actions 286N/A * for each warning, such as inserting the message in a log file or 286N/A * printing it to the console.</p> 286N/A * @param e The warning information encoded as an exception. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Receive notification of a recoverable parser error. 286N/A * <p>The default implementation does nothing. Application writers 286N/A * may override this method in a subclass to take specific actions 286N/A * for each error, such as inserting the message in a log file or 286N/A * printing it to the console.</p> 286N/A * @param e The error information encoded as an exception. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception. 286N/A * Report a fatal XML parsing error. 286N/A * <p>The default implementation throws a SAXParseException. 286N/A * Application writers may override this method in a subclass if 286N/A * they need to take specific actions for each fatal error (such as 286N/A * collecting all of the errors into a single report): in any case, 286N/A * the application must stop all regular processing when this 286N/A * method is invoked, since the document is no longer reliable, and 286N/A * the parser may no longer report parsing events.</p> 286N/A * @param e The error information encoded as an exception. 286N/A * @exception org.xml.sax.SAXException Any SAX exception, possibly 286N/A * wrapping another exception.