KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > xml > AbstractXMLConsumer


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.xml;
17
18 import org.apache.avalon.framework.logger.AbstractLogEnabled;
19 import org.xml.sax.Attributes JavaDoc;
20 import org.xml.sax.Locator JavaDoc;
21 import org.xml.sax.SAXException JavaDoc;
22
23 /**
24  * This abstract class provides default implementation of the methods specified
25  * by the <code>XMLConsumer</code> interface.
26  *
27  * @author <a HREF="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
28  * (Apache Software Foundation)
29  * @version CVS $Id: AbstractXMLConsumer.java 30932 2004-07-29 17:35:38Z vgritsenko $
30  */

31 public abstract class AbstractXMLConsumer extends AbstractLogEnabled implements XMLConsumer {
32
33     /**
34      * Receive an object for locating the origin of SAX document events.
35      *
36      * @param locator An object that can return the location of any SAX
37      * document event.
38      */

39     public void setDocumentLocator(Locator JavaDoc locator) {
40     }
41
42     /**
43      * Receive notification of the beginning of a document.
44      */

45     public void startDocument()
46     throws SAXException JavaDoc {
47     }
48
49     /**
50      * Receive notification of the end of a document.
51      */

52     public void endDocument()
53     throws SAXException JavaDoc {
54     }
55
56     /**
57      * Begin the scope of a prefix-URI Namespace mapping.
58      *
59      * @param prefix The Namespace prefix being declared.
60      * @param uri The Namespace URI the prefix is mapped to.
61      */

62     public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri)
63     throws SAXException JavaDoc {
64     }
65
66     /**
67      * End the scope of a prefix-URI mapping.
68      *
69      * @param prefix The prefix that was being mapping.
70      */

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

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

104     public void endElement(String JavaDoc uri, String JavaDoc loc, String JavaDoc raw)
105     throws SAXException JavaDoc {
106     }
107
108     /**
109      * Receive notification of character data.
110      *
111      * @param ch The characters from the XML document.
112      * @param start The start position in the array.
113      * @param len The number of characters to read from the array.
114      */

115     public void characters(char ch[], int start, int len)
116     throws SAXException JavaDoc {
117     }
118
119     /**
120      * Receive notification of ignorable whitespace in element content.
121      *
122      * @param ch The characters from the XML document.
123      * @param start The start position in the array.
124      * @param len The number of characters to read from the array.
125      */

126     public void ignorableWhitespace(char ch[], int start, int len)
127     throws SAXException JavaDoc {
128     }
129
130     /**
131      * Receive notification of a processing instruction.
132      *
133      * @param target The processing instruction target.
134      * @param data The processing instruction data, or null if none was
135      * supplied.
136      */

137     public void processingInstruction(String JavaDoc target, String JavaDoc data)
138     throws SAXException JavaDoc {
139     }
140
141     /**
142      * Receive notification of a skipped entity.
143      *
144      * @param name The name of the skipped entity. If it is a parameter
145      * entity, the name will begin with '%'.
146      */

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

160     public void startDTD(String JavaDoc name, String JavaDoc publicId, String JavaDoc systemId)
161     throws SAXException JavaDoc {
162     }
163
164     /**
165      * Report the end of DTD declarations.
166      */

167     public void endDTD()
168     throws SAXException JavaDoc {
169     }
170
171     /**
172      * Report the beginning of an entity.
173      *
174      * @param name The name of the entity. If it is a parameter entity, the
175      * name will begin with '%'.
176      */

177     public void startEntity(String JavaDoc name)
178     throws SAXException JavaDoc {
179     }
180
181     /**
182      * Report the end of an entity.
183      *
184      * @param name The name of the entity that is ending.
185      */

186     public void endEntity(String JavaDoc name)
187     throws SAXException JavaDoc {
188     }
189
190     /**
191      * Report the start of a CDATA section.
192      */

193     public void startCDATA()
194     throws SAXException JavaDoc {
195     }
196
197     /**
198      * Report the end of a CDATA section.
199      */

200     public void endCDATA()
201     throws SAXException JavaDoc {
202     }
203
204
205     /**
206      * Report an XML comment anywhere in the document.
207      *
208      * @param ch An array holding the characters in the comment.
209      * @param start The starting position in the array.
210      * @param len The number of characters to use from the array.
211      */

212     public void comment(char ch[], int start, int len)
213     throws SAXException JavaDoc {
214     }
215 }
216
Popular Tags