KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > serializer > EmptySerializer


1 /*
2  * Copyright 2003-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 /*
17  * $Id: EmptySerializer.java,v 1.5 2004/02/17 04:18:19 minchau Exp $
18  */

19 package com.sun.org.apache.xml.internal.serializer;
20
21 import java.io.IOException JavaDoc;
22 import java.io.OutputStream JavaDoc;
23 import java.io.Writer JavaDoc;
24 import java.util.Hashtable JavaDoc;
25 import java.util.Properties JavaDoc;
26 import java.util.Vector JavaDoc;
27
28 import javax.xml.transform.SourceLocator JavaDoc;
29 import javax.xml.transform.Transformer JavaDoc;
30
31 import org.w3c.dom.Node JavaDoc;
32 import org.xml.sax.Attributes JavaDoc;
33 import org.xml.sax.ContentHandler JavaDoc;
34 import org.xml.sax.Locator JavaDoc;
35 import org.xml.sax.SAXException JavaDoc;
36 import org.xml.sax.SAXParseException JavaDoc;
37
38 /**
39  * This class is an adapter class. Its only purpose is to be extended and
40  * for that extended class to over-ride all methods that are to be used.
41  */

42 public class EmptySerializer implements SerializationHandler
43 {
44     protected static final String JavaDoc ERR = "EmptySerializer method not over-ridden";
45     /**
46      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#asContentHandler()
47      */

48
49     private static void throwUnimplementedException()
50     {
51         /* TODO: throw this exception for real.
52          * Some users of this class do not over-ride all methods that
53          * they use, which is a violation of the intended use of this
54          * class. Those tests used to end in error, but fail when this
55          * exception is enabled. Perhaps that is an indication of what
56          * the true problem is. Such tests include copy56,58,59,60 for
57          * both Xalan-J interpretive and for XSLTC. - bjm
58          */

59         // throw new RuntimeException(err);
60
return;
61     }
62     /**
63      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#asContentHandler()
64      */

65     public ContentHandler JavaDoc asContentHandler() throws IOException JavaDoc
66     {
67         throwUnimplementedException();
68         return null;
69     }
70     /**
71      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setContentHandler(org.xml.sax.ContentHandler)
72      */

73     public void setContentHandler(ContentHandler JavaDoc ch)
74     {
75         throwUnimplementedException();
76     }
77     /**
78      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#close()
79      */

80     public void close()
81     {
82         throwUnimplementedException();
83     }
84     /**
85      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#getOutputFormat()
86      */

87     public Properties JavaDoc getOutputFormat()
88     {
89         throwUnimplementedException();
90         return null;
91     }
92     /**
93      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#getOutputStream()
94      */

95     public OutputStream JavaDoc getOutputStream()
96     {
97         throwUnimplementedException();
98         return null;
99     }
100     /**
101      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#getWriter()
102      */

103     public Writer JavaDoc getWriter()
104     {
105         throwUnimplementedException();
106         return null;
107     }
108     /**
109      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#reset()
110      */

111     public boolean reset()
112     {
113         throwUnimplementedException();
114         return false;
115     }
116     /**
117      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#serialize(org.w3c.dom.Node)
118      */

119     public void serialize(Node JavaDoc node) throws IOException JavaDoc
120     {
121         throwUnimplementedException();
122     }
123     /**
124      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setCdataSectionElements(java.util.Vector)
125      */

126     public void setCdataSectionElements(Vector JavaDoc URI_and_localNames)
127     {
128         throwUnimplementedException();
129     }
130     /**
131      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setEscaping(boolean)
132      */

133     public boolean setEscaping(boolean escape) throws SAXException JavaDoc
134     {
135         throwUnimplementedException();
136         return false;
137     }
138     /**
139      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setIndent(boolean)
140      */

141     public void setIndent(boolean indent)
142     {
143         throwUnimplementedException();
144     }
145     /**
146      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setIndentAmount(int)
147      */

148     public void setIndentAmount(int spaces)
149     {
150         throwUnimplementedException();
151     }
152     /**
153      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setOutputFormat(java.util.Properties)
154      */

155     public void setOutputFormat(Properties JavaDoc format)
156     {
157         throwUnimplementedException();
158     }
159     /**
160      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setOutputStream(java.io.OutputStream)
161      */

162     public void setOutputStream(OutputStream JavaDoc output)
163     {
164         throwUnimplementedException();
165     }
166     /**
167      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setVersion(java.lang.String)
168      */

169     public void setVersion(String JavaDoc version)
170     {
171         throwUnimplementedException();
172     }
173     /**
174      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setWriter(java.io.Writer)
175      */

176     public void setWriter(Writer JavaDoc writer)
177     {
178         throwUnimplementedException();
179     }
180     /**
181      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setTransformer(javax.xml.transform.Transformer)
182      */

183     public void setTransformer(Transformer JavaDoc transformer)
184     {
185         throwUnimplementedException();
186     }
187     /**
188      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#getTransformer()
189      */

190     public Transformer JavaDoc getTransformer()
191     {
192         throwUnimplementedException();
193         return null;
194     }
195     /**
196      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#flushPending()
197      */

198     public void flushPending() throws SAXException JavaDoc
199     {
200         throwUnimplementedException();
201     }
202     /**
203      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
204      */

205     public void addAttribute(
206         String JavaDoc uri,
207         String JavaDoc localName,
208         String JavaDoc rawName,
209         String JavaDoc type,
210         String JavaDoc value)
211         throws SAXException JavaDoc
212     {
213         throwUnimplementedException();
214     }
215     /**
216      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#addAttributes(org.xml.sax.Attributes)
217      */

218     public void addAttributes(Attributes JavaDoc atts) throws SAXException JavaDoc
219     {
220         throwUnimplementedException();
221     }
222     /**
223      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String)
224      */

225     public void addAttribute(String JavaDoc name, String JavaDoc value)
226     {
227         throwUnimplementedException();
228     }
229
230     /**
231      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#characters(java.lang.String)
232      */

233     public void characters(String JavaDoc chars) throws SAXException JavaDoc
234     {
235         throwUnimplementedException();
236     }
237     /**
238      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#endElement(java.lang.String)
239      */

240     public void endElement(String JavaDoc elemName) throws SAXException JavaDoc
241     {
242         throwUnimplementedException();
243     }
244     /**
245      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#startDocument()
246      */

247     public void startDocument() throws SAXException JavaDoc
248     {
249         throwUnimplementedException();
250     }
251     /**
252      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String)
253      */

254     public void startElement(String JavaDoc uri, String JavaDoc localName, String JavaDoc qName)
255         throws SAXException JavaDoc
256     {
257         throwUnimplementedException();
258     }
259     /**
260      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#startElement(java.lang.String)
261      */

262     public void startElement(String JavaDoc qName) throws SAXException JavaDoc
263     {
264         throwUnimplementedException();
265     }
266     /**
267      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#namespaceAfterStartElement(java.lang.String, java.lang.String)
268      */

269     public void namespaceAfterStartElement(String JavaDoc uri, String JavaDoc prefix)
270         throws SAXException JavaDoc
271     {
272         throwUnimplementedException();
273     }
274     /**
275      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#startPrefixMapping(java.lang.String, java.lang.String, boolean)
276      */

277     public boolean startPrefixMapping(
278         String JavaDoc prefix,
279         String JavaDoc uri,
280         boolean shouldFlush)
281         throws SAXException JavaDoc
282     {
283         throwUnimplementedException();
284         return false;
285     }
286     /**
287      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#entityReference(java.lang.String)
288      */

289     public void entityReference(String JavaDoc entityName) throws SAXException JavaDoc
290     {
291         throwUnimplementedException();
292     }
293     /**
294      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#getNamespaceMappings()
295      */

296     public NamespaceMappings getNamespaceMappings()
297     {
298         throwUnimplementedException();
299         return null;
300     }
301     /**
302      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#getPrefix(java.lang.String)
303      */

304     public String JavaDoc getPrefix(String JavaDoc uri)
305     {
306         throwUnimplementedException();
307         return null;
308     }
309     /**
310      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#getNamespaceURI(java.lang.String, boolean)
311      */

312     public String JavaDoc getNamespaceURI(String JavaDoc name, boolean isElement)
313     {
314         throwUnimplementedException();
315         return null;
316     }
317     /**
318      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#getNamespaceURIFromPrefix(java.lang.String)
319      */

320     public String JavaDoc getNamespaceURIFromPrefix(String JavaDoc prefix)
321     {
322         throwUnimplementedException();
323         return null;
324     }
325     /**
326      * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
327      */

328     public void setDocumentLocator(Locator JavaDoc arg0)
329     {
330         throwUnimplementedException();
331     }
332     /**
333      * @see org.xml.sax.ContentHandler#endDocument()
334      */

335     public void endDocument() throws SAXException JavaDoc
336     {
337         throwUnimplementedException();
338     }
339     /**
340      * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String)
341      */

342     public void startPrefixMapping(String JavaDoc arg0, String JavaDoc arg1)
343         throws SAXException JavaDoc
344     {
345         throwUnimplementedException();
346     }
347     /**
348      * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
349      */

350     public void endPrefixMapping(String JavaDoc arg0) throws SAXException JavaDoc
351     {
352         throwUnimplementedException();
353     }
354     /**
355      * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
356      */

357     public void startElement(
358         String JavaDoc arg0,
359         String JavaDoc arg1,
360         String JavaDoc arg2,
361         Attributes JavaDoc arg3)
362         throws SAXException JavaDoc
363     {
364         throwUnimplementedException();
365     }
366     /**
367      * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
368      */

369     public void endElement(String JavaDoc arg0, String JavaDoc arg1, String JavaDoc arg2)
370         throws SAXException JavaDoc
371     {
372         throwUnimplementedException();
373     }
374     /**
375      * @see org.xml.sax.ContentHandler#characters(char[], int, int)
376      */

377     public void characters(char[] arg0, int arg1, int arg2) throws SAXException JavaDoc
378     {
379         throwUnimplementedException();
380     }
381     /**
382      * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
383      */

384     public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
385         throws SAXException JavaDoc
386     {
387         throwUnimplementedException();
388     }
389     /**
390      * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
391      */

392     public void processingInstruction(String JavaDoc arg0, String JavaDoc arg1)
393         throws SAXException JavaDoc
394     {
395         throwUnimplementedException();
396     }
397     /**
398      * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
399      */

400     public void skippedEntity(String JavaDoc arg0) throws SAXException JavaDoc
401     {
402         throwUnimplementedException();
403     }
404     /**
405      * @see com.sun.org.apache.xml.internal.serializer.ExtendedLexicalHandler#comment(java.lang.String)
406      */

407     public void comment(String JavaDoc comment) throws SAXException JavaDoc
408     {
409         throwUnimplementedException();
410     }
411     /**
412      * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String, java.lang.String, java.lang.String)
413      */

414     public void startDTD(String JavaDoc arg0, String JavaDoc arg1, String JavaDoc arg2)
415         throws SAXException JavaDoc
416     {
417         throwUnimplementedException();
418     }
419     /**
420      * @see org.xml.sax.ext.LexicalHandler#endDTD()
421      */

422     public void endDTD() throws SAXException JavaDoc
423     {
424         throwUnimplementedException();
425     }
426     /**
427      * @see org.xml.sax.ext.LexicalHandler#startEntity(java.lang.String)
428      */

429     public void startEntity(String JavaDoc arg0) throws SAXException JavaDoc
430     {
431         throwUnimplementedException();
432     }
433     /**
434      * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String)
435      */

436     public void endEntity(String JavaDoc arg0) throws SAXException JavaDoc
437     {
438         throwUnimplementedException();
439     }
440     /**
441      * @see org.xml.sax.ext.LexicalHandler#startCDATA()
442      */

443     public void startCDATA() throws SAXException JavaDoc
444     {
445         throwUnimplementedException();
446     }
447     /**
448      * @see org.xml.sax.ext.LexicalHandler#endCDATA()
449      */

450     public void endCDATA() throws SAXException JavaDoc
451     {
452         throwUnimplementedException();
453     }
454     /**
455      * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
456      */

457     public void comment(char[] arg0, int arg1, int arg2) throws SAXException JavaDoc
458     {
459         throwUnimplementedException();
460     }
461     /**
462      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getDoctypePublic()
463      */

464     public String JavaDoc getDoctypePublic()
465     {
466         throwUnimplementedException();
467         return null;
468     }
469     /**
470      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getDoctypeSystem()
471      */

472     public String JavaDoc getDoctypeSystem()
473     {
474         throwUnimplementedException();
475         return null;
476     }
477     /**
478      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getEncoding()
479      */

480     public String JavaDoc getEncoding()
481     {
482         throwUnimplementedException();
483         return null;
484     }
485     /**
486      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getIndent()
487      */

488     public boolean getIndent()
489     {
490         throwUnimplementedException();
491         return false;
492     }
493     /**
494      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getIndentAmount()
495      */

496     public int getIndentAmount()
497     {
498         throwUnimplementedException();
499         return 0;
500     }
501     /**
502      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getMediaType()
503      */

504     public String JavaDoc getMediaType()
505     {
506         throwUnimplementedException();
507         return null;
508     }
509     /**
510      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getOmitXMLDeclaration()
511      */

512     public boolean getOmitXMLDeclaration()
513     {
514         throwUnimplementedException();
515         return false;
516     }
517     /**
518      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getStandalone()
519      */

520     public String JavaDoc getStandalone()
521     {
522         throwUnimplementedException();
523         return null;
524     }
525     /**
526      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#getVersion()
527      */

528     public String JavaDoc getVersion()
529     {
530         throwUnimplementedException();
531         return null;
532     }
533     /**
534      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setCdataSectionElements
535      */

536     public void setCdataSectionElements(Hashtable JavaDoc h) throws Exception JavaDoc
537     {
538         throwUnimplementedException();
539     }
540     /**
541      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setDoctype(java.lang.String, java.lang.String)
542      */

543     public void setDoctype(String JavaDoc system, String JavaDoc pub)
544     {
545         throwUnimplementedException();
546     }
547     /**
548      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setDoctypePublic(java.lang.String)
549      */

550     public void setDoctypePublic(String JavaDoc doctype)
551     {
552         throwUnimplementedException();
553     }
554     /**
555      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setDoctypeSystem(java.lang.String)
556      */

557     public void setDoctypeSystem(String JavaDoc doctype)
558     {
559         throwUnimplementedException();
560     }
561     /**
562      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setEncoding(java.lang.String)
563      */

564     public void setEncoding(String JavaDoc encoding)
565     {
566         throwUnimplementedException();
567     }
568     /**
569      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setMediaType(java.lang.String)
570      */

571     public void setMediaType(String JavaDoc mediatype)
572     {
573         throwUnimplementedException();
574     }
575     /**
576      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setOmitXMLDeclaration(boolean)
577      */

578     public void setOmitXMLDeclaration(boolean b)
579     {
580         throwUnimplementedException();
581     }
582     /**
583      * @see com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes#setStandalone(java.lang.String)
584      */

585     public void setStandalone(String JavaDoc standalone)
586     {
587         throwUnimplementedException();
588     }
589     /**
590      * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String, java.lang.String)
591      */

592     public void elementDecl(String JavaDoc arg0, String JavaDoc arg1) throws SAXException JavaDoc
593     {
594         throwUnimplementedException();
595     }
596     /**
597      * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
598      */

599     public void attributeDecl(
600         String JavaDoc arg0,
601         String JavaDoc arg1,
602         String JavaDoc arg2,
603         String JavaDoc arg3,
604         String JavaDoc arg4)
605         throws SAXException JavaDoc
606     {
607         throwUnimplementedException();
608     }
609     /**
610      * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String, java.lang.String)
611      */

612     public void internalEntityDecl(String JavaDoc arg0, String JavaDoc arg1)
613         throws SAXException JavaDoc
614     {
615         throwUnimplementedException();
616     }
617     /**
618      * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
619      */

620     public void externalEntityDecl(String JavaDoc arg0, String JavaDoc arg1, String JavaDoc arg2)
621         throws SAXException JavaDoc
622     {
623         throwUnimplementedException();
624     }
625     /**
626      * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
627      */

628     public void warning(SAXParseException JavaDoc arg0) throws SAXException JavaDoc
629     {
630         throwUnimplementedException();
631     }
632     /**
633      * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
634      */

635     public void error(SAXParseException JavaDoc arg0) throws SAXException JavaDoc
636     {
637         throwUnimplementedException();
638     }
639     /**
640      * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
641      */

642     public void fatalError(SAXParseException JavaDoc arg0) throws SAXException JavaDoc
643     {
644         throwUnimplementedException();
645     }
646     /**
647      * @see com.sun.org.apache.xml.internal.serializer.Serializer#asDOMSerializer()
648      */

649     public DOMSerializer asDOMSerializer() throws IOException JavaDoc
650     {
651         throwUnimplementedException();
652         return null;
653     }
654
655     /**
656      * @see com.sun.org.apache.xml.internal.serializer.SerializationHandler#setNamespaceMappings(NamespaceMappings)
657      */

658     public void setNamespaceMappings(NamespaceMappings mappings) {
659         throwUnimplementedException();
660     }
661     
662     /**
663      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#setSourceLocator(javax.xml.transform.SourceLocator)
664      */

665     public void setSourceLocator(SourceLocator JavaDoc locator)
666     {
667         throwUnimplementedException();
668     }
669
670     /**
671      * @see com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler#addUniqueAttribute(java.lang.String, java.lang.String, int)
672      */

673     public void addUniqueAttribute(String JavaDoc name, String JavaDoc value, int flags)
674         throws SAXException JavaDoc
675     {
676         throwUnimplementedException();
677     }
678 }
679
Popular Tags