KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > xml > AbstractXMLConsumer


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.xml;
9
10 import org.apache.avalon.framework.logger.AbstractLogEnabled;
11 import org.xml.sax.Attributes JavaDoc;
12 import org.xml.sax.Locator JavaDoc;
13 import org.xml.sax.SAXException JavaDoc;
14
15 /**
16  * This abstract class provides default implementation of the methods specified
17  * by the <code>XMLConsumer</code> interface.
18  *
19  * @author <a HREF="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
20  * (Apache Software Foundation, Exoffice Technologies)
21  * @version CVS $Revision: 1.4 $ $Date: 2001/12/11 09:53:38 $
22  */

23 public abstract class AbstractXMLConsumer
24 extends AbstractLogEnabled
25 implements XMLConsumer {
26
27     /**
28      * Receive an object for locating the origin of SAX document events.
29      *
30      * @param locator An object that can return the location of any SAX
31      * document event.
32      */

33     public void setDocumentLocator(Locator JavaDoc locator) {
34     }
35
36     /**
37      * Receive notification of the beginning of a document.
38      */

39     public void startDocument()
40     throws SAXException JavaDoc {
41     }
42
43     /**
44      * Receive notification of the end of a document.
45      */

46     public void endDocument()
47     throws SAXException JavaDoc {
48     }
49
50     /**
51      * Begin the scope of a prefix-URI Namespace mapping.
52      *
53      * @param prefix The Namespace prefix being declared.
54      * @param uri The Namespace URI the prefix is mapped to.
55      */

56     public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri)
57     throws SAXException JavaDoc {
58     }
59
60     /**
61      * End the scope of a prefix-URI mapping.
62      *
63      * @param prefix The prefix that was being mapping.
64      */

65     public void endPrefixMapping(String JavaDoc prefix)
66     throws SAXException JavaDoc {
67     }
68
69     /**
70      * Receive notification of the beginning of an element.
71      *
72      * @param uri The Namespace URI, or the empty string if the element has no
73      * Namespace URI or if Namespace
74      * processing is not being performed.
75      * @param loc The local name (without prefix), or the empty string if
76      * Namespace processing is not being performed.
77      * @param raw The raw XML 1.0 name (with prefix), or the empty string if
78      * raw names are not available.
79      * @param a The attributes attached to the element. If there are no
80      * attributes, it shall be an empty Attributes object.
81      */

82     public void startElement(String JavaDoc uri, String JavaDoc loc, String JavaDoc raw, Attributes JavaDoc a)
83     throws SAXException JavaDoc {
84     }
85
86
87     /**
88      * Receive notification of the end of an element.
89      *
90      * @param uri The Namespace URI, or the empty string if the element has no
91      * Namespace URI or if Namespace
92      * processing is not being performed.
93      * @param loc The local name (without prefix), or the empty string if
94      * Namespace processing is not being performed.
95      * @param raw The raw XML 1.0 name (with prefix), or the empty string if
96      * raw names are not available.
97      */

98     public void endElement(String JavaDoc uri, String JavaDoc loc, String JavaDoc raw)
99     throws SAXException JavaDoc {
100     }
101
102     /**
103      * Receive notification of character data.
104      *
105      * @param ch The characters from the XML document.
106      * @param start The start position in the array.
107      * @param len The number of characters to read from the array.
108      */

109     public void characters(char ch[], int start, int len)
110     throws SAXException JavaDoc {
111     }
112
113     /**
114      * Receive notification of ignorable whitespace in element content.
115      *
116      * @param ch The characters from the XML document.
117      * @param start The start position in the array.
118      * @param len The number of characters to read from the array.
119      */

120     public void ignorableWhitespace(char ch[], int start, int len)
121     throws SAXException JavaDoc {
122     }
123
124     /**
125      * Receive notification of a processing instruction.
126      *
127      * @param target The processing instruction target.
128      * @param data The processing instruction data, or null if none was
129      * supplied.
130      */

131     public void processingInstruction(String JavaDoc target, String JavaDoc data)
132     throws SAXException JavaDoc {
133     }
134
135     /**
136      * Receive notification of a skipped entity.
137      *
138      * @param name The name of the skipped entity. If it is a parameter
139      * entity, the name will begin with '%'.
140      */

141     public void skippedEntity(String JavaDoc name)
142     throws SAXException JavaDoc {
143     }
144
145     /**
146      * Report the start of DTD declarations, if any.
147      *
148      * @param name The document type name.
149      * @param publicId The declared public identifier for the external DTD
150      * subset, or null if none was declared.
151      * @param systemId The declared system identifier for the external DTD
152      * subset, or null if none was declared.
153      */

154     public void startDTD(String JavaDoc name, String JavaDoc publicId, String JavaDoc systemId)
155     throws SAXException JavaDoc {
156     }
157
158     /**
159      * Report the end of DTD declarations.
160      */

161     public void endDTD()
162     throws SAXException JavaDoc {
163     }
164
165     /**
166      * Report the beginning of an entity.
167      *
168      * @param name The name of the entity. If it is a parameter entity, the
169      * name will begin with '%'.
170      */

171     public void startEntity(String JavaDoc name)
172     throws SAXException JavaDoc {
173     }
174
175     /**
176      * Report the end of an entity.
177      *
178      * @param name The name of the entity that is ending.
179      */

180     public void endEntity(String JavaDoc name)
181     throws SAXException JavaDoc {
182     }
183
184     /**
185      * Report the start of a CDATA section.
186      */

187     public void startCDATA()
188     throws SAXException JavaDoc {
189     }
190
191     /**
192      * Report the end of a CDATA section.
193      */

194     public void endCDATA()
195     throws SAXException JavaDoc {
196     }
197
198
199     /**
200      * Report an XML comment anywhere in the document.
201      *
202      * @param ch An array holding the characters in the comment.
203      * @param start The starting position in the array.
204      * @param len The number of characters to use from the array.
205      */

206     public void comment(char ch[], int start, int len)
207     throws SAXException JavaDoc {
208     }
209 }
210
Popular Tags