KickJava   Java API By Example, From Geeks To Geeks.

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


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.ContentHandler JavaDoc;
19 import org.xml.sax.Locator JavaDoc;
20 import org.xml.sax.SAXException JavaDoc;
21 import org.xml.sax.Attributes JavaDoc;
22 import org.xml.sax.helpers.DefaultHandler JavaDoc;
23
24 /**
25  * Wrap a ContentHandler in a DefaultHandler
26  *
27  * @author <a HREF="mailto:tcurdt@apache.org">Torsten Curdt</a>
28  */

29
30
31 public final class DefaultHandlerWrapper extends DefaultHandler JavaDoc {
32     private final ContentHandler JavaDoc handler;
33
34     public DefaultHandlerWrapper( ContentHandler JavaDoc handler ) {
35         this.handler = handler;
36     }
37
38     public void setDocumentLocator(Locator JavaDoc locator) {
39         handler.setDocumentLocator(locator);
40     }
41
42     public void startDocument() throws SAXException JavaDoc {
43         handler.startDocument();
44     }
45
46     public void endDocument() throws SAXException JavaDoc {
47         handler.endDocument();
48     }
49
50     public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri) throws SAXException JavaDoc {
51         handler.startPrefixMapping(prefix,uri);
52     }
53
54     public void endPrefixMapping(String JavaDoc prefix) throws SAXException JavaDoc {
55         handler.endPrefixMapping(prefix);
56     }
57
58     public void startElement(String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc qName, Attributes JavaDoc atts) throws SAXException JavaDoc {
59         handler.startElement(namespaceURI,localName,qName,atts);
60     }
61
62     public void endElement(String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc qName) throws SAXException JavaDoc {
63         handler.endElement(namespaceURI,localName,qName);
64     }
65
66     public void characters(char ch[], int start, int length) throws SAXException JavaDoc {
67         handler.characters(ch,start,length);
68     }
69
70     public void ignorableWhitespace(char ch[], int start, int length) throws SAXException JavaDoc {
71         handler.ignorableWhitespace(ch,start, length);
72     }
73
74     public void processingInstruction(String JavaDoc target, String JavaDoc data) throws SAXException JavaDoc {
75         handler.processingInstruction(target,data);
76     }
77
78     public void skippedEntity(String JavaDoc name) throws SAXException JavaDoc {
79         handler.skippedEntity(name);
80     }
81
82
83 }
84
Popular Tags