KickJava   Java API By Example, From Geeks To Geeks.

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


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.xml.sax.Attributes JavaDoc;
19 import org.xml.sax.Locator JavaDoc;
20 import org.xml.sax.SAXException JavaDoc;
21
22 /**
23  * This class provides a bridge class to connect to existing content
24  * handlers and lexical handlers.
25  *
26  * @author <a HREF="mailto:stefano@apache.org">Stefano Mazzocchi</a>
27  * @version CVS $Id: AbstractXMLPipe.java 226786 2005-08-01 13:10:02Z sylvain $
28  */

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

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

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

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

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

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

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

109     public void endElement(String JavaDoc uri, String JavaDoc loc, String JavaDoc raw)
110     throws SAXException JavaDoc {
111         contentHandler.endElement(uri, loc, raw);
112     }
113
114     /**
115      * Receive notification of character data.
116      *
117      * @param c The characters from the XML document.
118      * @param start The start position in the array.
119      * @param len The number of characters to read from the array.
120      */

121     public void characters(char c[], int start, int len)
122     throws SAXException JavaDoc {
123         contentHandler.characters(c, start, len);
124     }
125
126     /**
127      * Receive notification of ignorable whitespace in element content.
128      *
129      * @param c The characters from the XML document.
130      * @param start The start position in the array.
131      * @param len The number of characters to read from the array.
132      */

133     public void ignorableWhitespace(char c[], int start, int len)
134     throws SAXException JavaDoc {
135         contentHandler.ignorableWhitespace(c, start, len);
136     }
137
138     /**
139      * Receive notification of a processing instruction.
140      *
141      * @param target The processing instruction target.
142      * @param data The processing instruction data, or null if none was
143      * supplied.
144      */

145     public void processingInstruction(String JavaDoc target, String JavaDoc data)
146     throws SAXException JavaDoc {
147         contentHandler.processingInstruction(target, data);
148     }
149
150     /**
151      * Receive notification of a skipped entity.
152      *
153      * @param name The name of the skipped entity. If it is a parameter
154      * entity, the name will begin with '%'.
155      */

156     public void skippedEntity(String JavaDoc name)
157     throws SAXException JavaDoc {
158         contentHandler.skippedEntity(name);
159     }
160
161     /**
162      * Report the start of DTD declarations, if any.
163      *
164      * @param name The document type name.
165      * @param publicId The declared public identifier for the external DTD
166      * subset, or null if none was declared.
167      * @param systemId The declared system identifier for the external DTD
168      * subset, or null if none was declared.
169      */

170     public void startDTD(String JavaDoc name, String JavaDoc publicId, String JavaDoc systemId)
171     throws SAXException JavaDoc {
172         lexicalHandler.startDTD(name, publicId, systemId);
173     }
174
175     /**
176      * Report the end of DTD declarations.
177      */

178     public void endDTD()
179     throws SAXException JavaDoc {
180         lexicalHandler.endDTD();
181     }
182
183     /**
184      * Report the beginning of an entity.
185      *
186      * @param name The name of the entity. If it is a parameter entity, the
187      * name will begin with '%'.
188      */

189     public void startEntity(String JavaDoc name)
190     throws SAXException JavaDoc {
191         lexicalHandler.startEntity(name);
192     }
193
194     /**
195      * Report the end of an entity.
196      *
197      * @param name The name of the entity that is ending.
198      */

199     public void endEntity(String JavaDoc name)
200     throws SAXException JavaDoc {
201         lexicalHandler.endEntity(name);
202     }
203
204     /**
205      * Report the start of a CDATA section.
206      */

207     public void startCDATA()
208     throws SAXException JavaDoc {
209         lexicalHandler.startCDATA();
210     }
211
212     /**
213      * Report the end of a CDATA section.
214      */

215     public void endCDATA()
216     throws SAXException JavaDoc {
217         lexicalHandler.endCDATA();
218     }
219
220     /**
221      * Report an XML comment anywhere in the document.
222      *
223      * @param ch An array holding the characters in the comment.
224      * @param start The starting position in the array.
225      * @param len The number of characters to use from the array.
226      */

227     public void comment(char ch[], int start, int len)
228     throws SAXException JavaDoc {
229         lexicalHandler.comment(ch, start, len);
230     }
231 }
232
Popular Tags