KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > xml > AbstractElementDefinitionHandler


1 /* ========================================================================
2  * JCommon : a free general purpose class library for the Java(tm) platform
3  * ========================================================================
4  *
5  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
6  *
7  * Project Info: http://www.jfree.org/jcommon/index.html
8  *
9  * This library is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22  * USA.
23  *
24  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25  * in the United States and other countries.]
26  *
27  * -------------------------------------
28  * AbstractElementDefinitionHandler.java
29  * -------------------------------------
30  * (C)opyright 2003-2005, by Thomas Morgner and Contributors.
31  *
32  * Original Author: Thomas Morgner;
33  * Contributor(s): David Gilbert (for Object Refinery Limited);
34  *
35  * $Id: AbstractElementDefinitionHandler.java,v 1.3 2005/10/18 13:25:44 mungady Exp $
36  *
37  * Changes
38  * -------------------------
39  * 23.06.2003 : Initial version
40  *
41  */

42
43 package org.jfree.xml;
44
45 import org.xml.sax.Attributes JavaDoc;
46 import org.xml.sax.SAXException JavaDoc;
47
48 /**
49  * An abstract element definition handler.
50  *
51  * @author Thomas Morgner
52  */

53 public abstract class AbstractElementDefinitionHandler implements ElementDefinitionHandler {
54
55     /** A parser. */
56     private Parser parser;
57
58     /**
59      * Creates a new handler.
60      *
61      * @param parser the parser.
62      */

63     public AbstractElementDefinitionHandler(final Parser parser) {
64         this.parser = parser;
65     }
66
67     /**
68      * Callback to indicate that an XML element start tag has been read by the parser.
69      *
70      * @param tagName the tag name.
71      * @param attrs the attributes.
72      *
73      * @throws SAXException if a parser error occurs or the validation failed.
74      */

75     public void startElement(final String JavaDoc tagName, final Attributes JavaDoc attrs) throws SAXException JavaDoc {
76         // nothing required
77
}
78
79     /**
80      * Callback to indicate that some character data has been read.
81      *
82      * @param ch the character array.
83      * @param start the start index for the characters.
84      * @param length the length of the character sequence.
85      * @throws SAXException if a parser error occurs or the validation failed.
86      */

87     public void characters(final char[] ch, final int start, final int length) throws SAXException JavaDoc {
88         // nothing required
89
}
90
91     /**
92      * Callback to indicate that an XML element end tag has been read by the parser.
93      *
94      * @param tagName the tag name.
95      *
96      * @throws SAXException if a parser error occurs or the validation failed.
97      */

98     public void endElement(final String JavaDoc tagName) throws SAXException JavaDoc {
99         // nothing required
100
}
101
102     /**
103      * Returns the parser.
104      *
105      * @return The parser.
106      */

107     public Parser getParser() {
108         return this.parser;
109     }
110 }
111
Popular Tags