001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.utils.stax;
022
023import org.xml.sax.Attributes;
024import org.xml.sax.Locator;
025import org.xml.sax.SAXException;
026
027/**
028 * Simple implementation of the <code>StAXContentHandler</code>
029 * interface, with empty implementations for all the methods.
030 *
031 * <p>
032 * This class is provided as a base for content handlers where
033 * the implementor does not wish to provide all the methods.
034 * </p>
035 *
036 * @author Thomas Down
037 */
038
039public class StAXContentHandlerBase implements StAXContentHandler {
040    public void startTree()
041        throws SAXException
042    {
043    }
044
045    public void endTree()
046        throws SAXException
047    {
048    }
049
050    /**
051     * Signal a span of character data in the XML input.
052     *
053     * @param ch an array of characters
054     * @param start index of the first significant character for this event.
055     * @param length number of characters significant to this event.
056     */
057
058    public void characters(char[] ch,
059                           int start,
060                           int length)
061        throws SAXException
062    {
063    }
064
065    public void ignorableWhitespace(char[] ch,
066                                    int start,
067                                    int length)
068        throws SAXException
069    {
070    }
071
072    public void startPrefixMapping(String prefix, String uri)
073        throws SAXException
074    {
075    }
076
077    public void endPrefixMapping(String prefix)
078        throws SAXException
079    {
080    }
081
082    public void processingInstruction(String target, String data)
083        throws SAXException
084    {
085    }
086
087    public void setDocumentLocator(Locator locator)
088    {
089    }
090
091    public void skippedEntity(String name)
092        throws SAXException
093    {
094    }
095
096    public void startElement(String nsURI,
097                             String localName,
098                             String qName,
099                             Attributes attrs,
100                             DelegationManager dm)
101        throws SAXException
102    {
103    }
104
105    public void endElement(String nsURI,
106                           String localName,
107                           String qName,
108                           StAXContentHandler delegate)
109        throws SAXException
110    {
111    }
112}