KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mr > core > util > xml > sax > SAXManipulator


1 package org.mr.core.util.xml.sax;
2
3 import org.mr.core.util.xml.XMLManipulator;
4 import org.xml.sax.Attributes JavaDoc;
5 import org.xml.sax.ContentHandler JavaDoc;
6 import org.xml.sax.Locator JavaDoc;
7 import org.xml.sax.SAXException JavaDoc;
8 import org.xml.sax.ext.LexicalHandler JavaDoc;
9
10 /*
11  * Copyright 2002 by
12  * <a HREF="http://www.coridan.com">Coridan</a>
13  * <a HREF="mailto: support@coridan.com ">support@coridan.com</a>
14  *
15  * The contents of this file are subject to the Mozilla Public License Version
16  * 1.1 (the "License"); you may not use this file except in compliance with the
17  * License. You may obtain a copy of the License at
18  * http://www.mozilla.org/MPL/
19  *
20  * Software distributed under the License is distributed on an "AS IS" basis,
21  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
22  * for the specific language governing rights and limitations under the
23  * License.
24  *
25  * The Original Code is "MantaRay" (TM).
26  *
27  * The Initial Developer of the Original Code is Coridan.
28  * Portions created by the Initial Developer are Copyright (C) 2006
29  * Coridan Inc. All Rights Reserved.
30  *
31  * Contributor(s): all the names of the contributors are added in the source
32  * code where applicable.
33  *
34  * Alternatively, the contents of this file may be used under the terms of the
35  * LGPL license (the "GNU LESSER GENERAL PUBLIC LICENSE"), in which case the
36  * provisions of LGPL are applicable instead of those above. If you wish to
37  * allow use of your version of this file only under the terms of the LGPL
38  * License and not to allow others to use your version of this file under
39  * the MPL, indicate your decision by deleting the provisions above and
40  * replace them with the notice and other provisions required by the LGPL.
41  * If you do not delete the provisions above, a recipient may use your version
42  * of this file under either the MPL or the GNU LESSER GENERAL PUBLIC LICENSE.
43  
44  *
45  * This library is free software; you can redistribute it and/or modify it
46  * under the terms of the MPL as stated above or under the terms of the GNU
47  * Lesser General Public License as published by the Free Software Foundation;
48  * either version 2.1 of the License, or any later version.
49  *
50  * This library is distributed in the hope that it will be useful, but WITHOUT
51  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
52  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
53  * License for more details.
54  */

55
56  /**
57  * User: Moti Tal
58  * Date: Feb 22, 2005
59  * Time: 2:33:23 PM
60  * To change this template use File | Settings | File Templates.
61  */

62 public class SAXManipulator extends XMLManipulator implements ContentHandler JavaDoc, LexicalHandler JavaDoc{
63
64     /////////////////////////////////////////////////////////////////////////
65
///// impl ContentHandler
66
/////////////////////////////////////////////////////////////////////////
67

68     /**
69      * Receive an object for locating the origin of SAX document events.
70      *
71      * @param locator An object that can return the location of any SAX
72      * document event.
73      */

74     public void setDocumentLocator(Locator JavaDoc locator) {
75     }
76
77     /**
78      * Receive notification of the beginning of a document.
79      */

80     public void startDocument()
81     throws SAXException JavaDoc {
82     }
83
84     /**
85      * Receive notification of the end of a document.
86      */

87     public void endDocument()
88     throws SAXException JavaDoc {
89     }
90
91     /**
92      * Begin the scope of a prefix-URI Namespace mapping.
93      *
94      * @param prefix The Namespace prefix being declared.
95      * @param uri The Namespace URI the prefix is mapped to.
96      */

97     public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri)
98     throws SAXException JavaDoc {
99     }
100
101     /**
102      * End the scope of a prefix-URI mapping.
103      *
104      * @param prefix The prefix that was being mapping.
105      */

106     public void endPrefixMapping(String JavaDoc prefix)
107     throws SAXException JavaDoc {
108     }
109
110     /**
111      * Receive notification of the beginning of an element.
112      *
113      * @param uri The Namespace URI, or the empty string if the element has no
114      * Namespace URI or if Namespace
115      * processing is not being performed.
116      * @param loc The local name (without prefix), or the empty string if
117      * Namespace processing is not being performed.
118      * @param raw The raw XML 1.0 name (with prefix), or the empty string if
119      * raw names are not available.
120      * @param a The attributes attached to the element. If there are no
121      * attributes, it shall be an empty Attributes object.
122      */

123     public void startElement(String JavaDoc uri, String JavaDoc loc, String JavaDoc raw, Attributes JavaDoc a)
124     throws SAXException JavaDoc {
125
126     }
127
128
129     /**
130      * Receive notification of the end of an element.
131      *
132      * @param uri The Namespace URI, or the empty string if the element has no
133      * Namespace URI or if Namespace
134      * processing is not being performed.
135      * @param loc The local name (without prefix), or the empty string if
136      * Namespace processing is not being performed.
137      * @param raw The raw XML 1.0 name (with prefix), or the empty string if
138      * raw names are not available.
139      */

140     public void endElement(String JavaDoc uri, String JavaDoc loc, String JavaDoc raw)
141     throws SAXException JavaDoc {
142     }
143
144     /**
145      * Receive notification of character data.
146      *
147      * @param c The characters from the XML document.
148      * @param start The start position in the array.
149      * @param len The number of characters to read from the array.
150      */

151     public void characters(char c[], int start, int len)
152     throws SAXException JavaDoc {
153     }
154
155     /**
156      * Receive notification of ignorable whitespace in element content.
157      *
158      * @param c The characters from the XML document.
159      * @param start The start position in the array.
160      * @param len The number of characters to read from the array.
161      */

162     public void ignorableWhitespace(char c[], int start, int len)
163     throws SAXException JavaDoc {
164     }
165
166     /**
167      * Receive notification of a processing instruction.
168      *
169      * @param target The processing instruction target.
170      * @param data The processing instruction data, or null if none was
171      * supplied.
172      */

173     public void processingInstruction(String JavaDoc target, String JavaDoc data)
174     throws SAXException JavaDoc {
175     }
176
177     /**
178      * Receive notification of a skipped entity.
179      *
180      * @param name The name of the skipped entity. If it is a parameter
181      * entity, the name will begin with '%'.
182      */

183     public void skippedEntity(String JavaDoc name)
184     throws SAXException JavaDoc {
185     }
186
187
188     /////////////////////////////////////////////////////////////////////////
189
///// impl LexicalHandler
190
/////////////////////////////////////////////////////////////////////////
191

192     /**
193      * Report the start of DTD declarations, if any.
194      *
195      * @param name The document type name.
196      * @param publicId The declared public identifier for the external DTD
197      * subset, or null if none was declared.
198      * @param systemId The declared system identifier for the external DTD
199      * subset, or null if none was declared.
200      */

201     public void startDTD(String JavaDoc name, String JavaDoc publicId, String JavaDoc systemId)
202     throws SAXException JavaDoc {
203     }
204
205     /**
206      * Report the end of DTD declarations.
207      */

208     public void endDTD()
209     throws SAXException JavaDoc {
210     }
211
212     /**
213      * Report the beginning of an entity.
214      *
215      * @param name The name of the entity. If it is a parameter entity, the
216      * name will begin with '%'.
217      */

218     public void startEntity(String JavaDoc name)
219     throws SAXException JavaDoc {
220     }
221
222     /**
223      * Report the end of an entity.
224      *
225      * @param name The name of the entity that is ending.
226      */

227     public void endEntity(String JavaDoc name)
228     throws SAXException JavaDoc {
229     }
230
231     /**
232      * Report the start of a CDATA section.
233      */

234     public void startCDATA()
235     throws SAXException JavaDoc {
236     }
237
238     /**
239      * Report the end of a CDATA section.
240      */

241     public void endCDATA()
242     throws SAXException JavaDoc {
243     }
244
245     /**
246      * Report an XML comment anywhere in the document.
247      *
248      * @param ch An array holding the characters in the comment.
249      * @param start The starting position in the array.
250      * @param len The number of characters to use from the array.
251      */

252     public void comment(char ch[], int start, int len)
253     throws SAXException JavaDoc {
254     }
255 }
Popular Tags