KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > znerd > xmlenc > XMLEventListenerStates


1 /*
2  * $Id: XMLEventListenerStates.java,v 1.3 2003/05/08 08:28:18 znerd Exp $
3  */

4 package org.znerd.xmlenc;
5
6 /**
7  * All <code>XMLEventListenerState</code>s.
8  *
9  * @version $Revision: 1.3 $ $Date: 2003/05/08 08:28:18 $
10  * @author Ernst de Haan (<a HREF="mailto:znerd@FreeBSD.org">znerd@FreeBSD.org</a>)
11  *
12  * @since xmlenc 0.31
13  */

14 public interface XMLEventListenerStates {
15
16    /**
17     * Uninitialized state. In this state no events notifications are valid.
18     */

19    static final XMLEventListenerState UNINITIALIZED = new XMLEventListenerState("UNINITIALIZED");
20
21    /**
22     * The initial initialized state. No XML declaration has been written, no
23     * DTD declaration, nothing at all.
24     *
25     * <p />In this state the following event notifications are valid:
26     *
27     * <ul>
28     * <li>XML declaration ({@link XMLEventListener#declaration()})</li>
29     * <li>DTD declaration ({@link XMLEventListener#dtd(String,String,String)})</li>
30     * <li>white space ({@link XMLEventListener#whitespace(String)})</li>
31     * <li>comment ({@link XMLEventListener#comment(String)})</li>
32     * <li>processing instruction ({@link XMLEventListener#pi(String,String)})</li>
33     * <li>start tag ({@link XMLEventListener#startTag(String)})</li>
34     * </ul>
35     */

36    static final XMLEventListenerState BEFORE_XML_DECLARATION = new XMLEventListenerState("BEFORE_XML_DECLARATION");
37
38    /**
39     * State after XML declaration but before the DTD declaration, if any. This
40     * state is reached right after a {@link XMLEventListener#declaration()}
41     * event notification.
42     *
43     * <p />In this state the following event notifications are valid:
44     *
45     * <ul>
46     * <li>DTD declaration ({@link XMLEventListener#dtd(String,String,String)})</li>
47     * <li>white space ({@link XMLEventListener#whitespace(String)})</li>
48     * <li>comment ({@link XMLEventListener#comment(String)})</li>
49     * <li>processing instruction ({@link XMLEventListener#pi(String,String)})</li>
50     * <li>start tag ({@link XMLEventListener#startTag(String)})</li>
51     * </ul>
52     */

53    static final XMLEventListenerState BEFORE_DTD_DECLARATION = new XMLEventListenerState("BEFORE_DTD_DECLARATION");
54
55    /**
56     * State after DTD declaration but before the root element. This
57     * state is reached right after a
58     * {@link XMLEventListener#dtd(String,String,String)} event notification.
59     *
60     * <p />In this state the following event notifications are valid:
61     *
62     * <ul>
63     * <li>white space ({@link XMLEventListener#whitespace(String)})</li>
64     * <li>comment ({@link XMLEventListener#comment(String)})</li>
65     * <li>processing instruction ({@link XMLEventListener#pi(String,String)})</li>
66     * <li>start tag ({@link XMLEventListener#startTag(String)})</li>
67     * </ul>
68     */

69    static final XMLEventListenerState BEFORE_ROOT_ELEMENT = new XMLEventListenerState("BEFORE_ROOT_ELEMENT");
70
71    /**
72     * State in which a start tag is still open. This state is entered after
73     * {@link XMLEventListener#startTag(String)} is called.
74     *
75     * <p />In this state the following event notifications are valid:
76     *
77     * <ul>
78     * <li>white space ({@link XMLEventListener#whitespace(String)})</li>
79     * <li>comment ({@link XMLEventListener#comment(String)})</li>
80     * <li>processing instruction ({@link XMLEventListener#pi(String,String)})</li>
81     * <li>attribute ({@link XMLEventListener#attribute(String,String)})</li>
82     * <li>another start tag ({@link XMLEventListener#startTag(String)})</li>
83     * <li>end tag ({@link XMLEventListener#endTag()})</li>
84     * </ul>
85     */

86    static final XMLEventListenerState START_TAG_OPEN = new XMLEventListenerState("START_TAG_OPEN");
87
88    /**
89     * State within an element, start tag is closed.
90     *
91     * <p />In this state the following event notifications are valid:
92     *
93     * <ul>
94     * <li>white space ({@link XMLEventListener#whitespace(String)})</li>
95     * <li>comment ({@link XMLEventListener#comment(String)})</li>
96     * <li>processing instruction ({@link XMLEventListener#pi(String,String)})</li>
97     * <li>start tag ({@link XMLEventListener#startTag(String)})</li>
98     * <li>end tag ({@link XMLEventListener#endTag()})</li>
99     * </ul>
100     */

101    static final XMLEventListenerState WITHIN_ELEMENT = new XMLEventListenerState("WITHIN_ELEMENT");
102
103    /**
104     * State after the root element.
105     *
106     * <p />In this state the following event notifications are valid:
107     *
108     * <ul>
109     * <li>whitespace ({@link XMLEventListener#whitespace(String)})</li>
110     * <li>comment ({@link XMLEventListener#comment(String)})</li>
111     * <li>processing instruction ({@link XMLEventListener#pi(String,String)})</li>
112     * </ul>
113     */

114    static final XMLEventListenerState AFTER_ROOT_ELEMENT = new XMLEventListenerState("AFTER_ROOT_ELEMENT");
115
116    /**
117     * State entered when the document is ended. No more event notifications are
118     * valid.
119     */

120    static final XMLEventListenerState DOCUMENT_ENDED = new XMLEventListenerState("DOCUMENT_ENDED");
121
122    /**
123     * State reached when there was an error while writing output. No more
124     * event notifications are valid.
125     */

126    static final XMLEventListenerState ERROR_STATE = new XMLEventListenerState("ERROR_STATE");
127 }
128
Popular Tags