KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > publisher > serverimpl > StripDocumentHandler


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
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.outerj.daisy.publisher.serverimpl;
17
18 import org.xml.sax.ContentHandler JavaDoc;
19 import org.xml.sax.SAXException JavaDoc;
20 import org.xml.sax.Locator JavaDoc;
21 import org.xml.sax.Attributes JavaDoc;
22
23 /**
24  * Removes startDocument and endDocument events from the SAX stream.
25  */

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