KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > util > xml > parser > HandlerStateIF


1 package org.sapia.util.xml.parser;
2
3
4 // Imports of David Meggison's SAX classes
5
// ---------------------------------------
6
import org.xml.sax.Attributes JavaDoc;
7 import org.xml.sax.SAXException JavaDoc;
8
9
10 /**
11  * The <CODE>HandlerStateIF</CODE> interface represents a givent "state" of an
12  * XML parser that knows how to handle the events. The necessary logic to parse
13  * a complex XML document can be split into multiple <CODE>HandlerStateIF</CODE>
14  * where each instance has the logic for a specific XML element.<P>
15  *
16  * The <CODE>HandlerStateIF</CODE> is a modified SAX event handler. It provides
17  * the main callback methods and each of have a extra parameter from the SAX
18  * version: a <CODE>HandlerContextIF</CODE>. The context object is the controller
19  * that contains the stack of current handler states and it is the bridge between
20  * a <CODE>HandlerStateIF</CODE> and the SAX event handler.
21  *
22  * @see HandlerContextIF
23  * @see StatefullSAXHandler
24  * @author Jean-Cedric Desrochers
25  * <dl>
26  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
27  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
28  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
29  * </dl>
30  */

31 public interface HandlerStateIF {
32   /**
33    * Receives the notification of the the start of an element.
34    *
35    * @param aContext The handler context.
36    * @param anUri The namespace URI associated with the element
37    * @param aLocalName The element type local name.
38    * @param aQualifiedName The element type qualified name.
39    * @param someAttributes The specified or defaulted attributes.
40    * @exception SAXException If an exception occurs.
41    */

42   public void startElement(HandlerContextIF aContext, String JavaDoc anUri,
43     String JavaDoc aLocalName, String JavaDoc aQualifiedName, Attributes JavaDoc someAttributes)
44     throws SAXException JavaDoc;
45
46   /**
47    * Receives the notification of the the end of an element.
48    *
49    * @param aContext The handler context.
50    * @param aLocalName The element type local name.
51    * @param aQualifiedName The element type qualified name.
52    * @exception SAXException If an exception occurs.
53    */

54   public void endElement(HandlerContextIF aContext, String JavaDoc anUri,
55     String JavaDoc aLocalName, String JavaDoc aQualifiedName) throws SAXException JavaDoc;
56
57   /**
58    * Receives the notification of character data inside an element.
59    *
60    * @param aContext The handler context.
61    * @param someChars The characters.
62    * @param anOffset The start position in the character array.
63    * @param aLength The number of characters to use from the character array.
64    * @exception SAXException If an exception occurs.
65    */

66   public void characters(HandlerContextIF aContext, char[] someChars,
67     int anOffset, int length) throws SAXException JavaDoc;
68
69   /**
70    * Receives the notification of ignorable whitespace in element content.
71    *
72    * @param aContext The handler context.
73    * @param someChars The whitespace characters.
74    * @param anOffset The start position in the character array.
75    * @param aLength The number of characters to use from the character array.
76    * @exception SAXException If an exception occurs.
77    */

78   public void ignorableWhitespace(HandlerContextIF aContext, char[] someChars,
79     int anOffset, int aLength) throws SAXException JavaDoc;
80 }
81
Popular Tags