01: /* ========================================================================
02: * JCommon : a free general purpose class library for the Java(tm) platform
03: * ========================================================================
04: *
05: * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
06: *
07: * Project Info: http://www.jfree.org/jcommon/index.html
08: *
09: * 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: * ElementDefinitionHandler.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: ElementDefinitionHandler.java,v 1.4 2005/11/14 10:57:22 mungady Exp $
36: *
37: * Changes
38: * -------
39: * 21-Feb-2003 : Added standard header and Javadocs (DG);
40: * 29-Apr-2003 : Distilled from the JFreeReport project and moved into JCommon
41: *
42: */
43:
44: package org.jfree.xml;
45:
46: import org.xml.sax.Attributes;
47: import org.xml.sax.SAXException;
48:
49: /**
50: * A element definition handler. The element definition handler is used to
51: * represent a certain parser state. The current state is set in the parser
52: * using the pushFactory() method. The parser forwards any incoming SAXEvent
53: * to the current handler, until the handler is removed with popFactory().
54: *
55: * @author Thomas Morgner
56: */
57: public interface ElementDefinitionHandler {
58:
59: /**
60: * Callback to indicate that an XML element start tag has been read by the parser.
61: *
62: * @param tagName the tag name.
63: * @param attrs the attributes.
64: *
65: * @throws SAXException if a parser error occurs or the validation failed.
66: */
67: public void startElement(String tagName, Attributes attrs)
68: throws SAXException;
69:
70: /**
71: * Callback to indicate that some character data has been read.
72: *
73: * @param ch the character array.
74: * @param start the start index for the characters.
75: * @param length the length of the character sequence.
76: * @throws SAXException if a parser error occurs or the validation failed.
77: */
78: public void characters(char[] ch, int start, int length)
79: throws SAXException;
80:
81: /**
82: * Callback to indicate that an XML element end tag has been read by the parser.
83: *
84: * @param tagName the tag name.
85: *
86: * @throws SAXException if a parser error occurs or the validation failed.
87: */
88: public void endElement(String tagName) throws SAXException;
89:
90: /**
91: * Returns the parser.
92: *
93: * @return The parser.
94: */
95: public Parser getParser();
96:
97: }
|