1/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements.  See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22package com.sun.org.apache.xerces.internal.util;
23
24import com.sun.org.apache.xerces.internal.xni.Augmentations;
25import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
26import com.sun.org.apache.xerces.internal.xni.QName;
27import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
28import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
29import com.sun.org.apache.xerces.internal.xni.XMLLocator;
30import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
31import com.sun.org.apache.xerces.internal.xni.XMLString;
32import com.sun.org.apache.xerces.internal.xni.XNIException;
33import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
34import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
35
36/**
37 * Default implementation of {@link XMLDocumentFilter}
38 * that simply passes through events to the next component.
39 *
40 * <p>
41 * Can be used as a base implementation of other more sophisticated
42 * {@link XMLDocumentFilter}s.
43 *
44 * @author
45 *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
46 */
47public class XMLDocumentFilterImpl implements XMLDocumentFilter {
48    private XMLDocumentHandler next;
49    private XMLDocumentSource source;
50
51
52    public void setDocumentHandler(XMLDocumentHandler handler) {
53        this.next = handler;
54    }
55
56    public XMLDocumentHandler getDocumentHandler() {
57        return next;
58    }
59
60    public void setDocumentSource(XMLDocumentSource source) {
61        this.source = source;
62    }
63
64    public XMLDocumentSource getDocumentSource() {
65        return source;
66    }
67
68
69
70
71
72
73    public void characters(XMLString text, Augmentations augs) throws XNIException {
74        next.characters(text, augs);
75    }
76
77    public void comment(XMLString text, Augmentations augs) throws XNIException {
78        next.comment(text, augs);
79    }
80
81    public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
82        throws XNIException {
83        next.doctypeDecl(rootElement, publicId, systemId, augs);
84    }
85
86    public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
87        next.emptyElement(element, attributes, augs);
88    }
89
90    public void endCDATA(Augmentations augs) throws XNIException {
91        next.endCDATA(augs);
92    }
93
94    public void endDocument(Augmentations augs) throws XNIException {
95        next.endDocument(augs);
96    }
97
98    public void endElement(QName element, Augmentations augs) throws XNIException {
99        next.endElement(element, augs);
100    }
101
102    public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
103        next.endGeneralEntity(name, augs);
104    }
105
106    public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
107        next.ignorableWhitespace(text, augs);
108    }
109
110    public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException {
111        next.processingInstruction(target, data, augs);
112    }
113
114    public void startCDATA(Augmentations augs) throws XNIException {
115        next.startCDATA(augs);
116    }
117
118    public void startDocument(
119        XMLLocator locator,
120        String encoding,
121        NamespaceContext namespaceContext,
122        Augmentations augs)
123        throws XNIException {
124        next.startDocument(locator, encoding, namespaceContext, augs);
125    }
126
127    public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
128        next.startElement(element, attributes, augs);
129    }
130
131    public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
132        throws XNIException {
133        next.startGeneralEntity(name, identifier, encoding, augs);
134    }
135
136    public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
137        next.textDecl(version, encoding, augs);
138    }
139
140    public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException {
141        next.xmlDecl(version, encoding, standalone, augs);
142    }
143}
144