001    /*
002     **
003     ** Licensed to the Apache Software Foundation (ASF) under one
004     ** or more contributor license agreements.  See the NOTICE file
005     ** distributed with this work for additional information
006     ** regarding copyright ownership.  The ASF licenses this file
007     ** to you under the Apache License, Version 2.0 (the
008     ** "License"); you may not use this file except in compliance
009     ** with the License.  You may obtain a copy of the License at
010     **
011     **  http://www.apache.org/licenses/LICENSE-2.0
012     **
013     ** Unless required by applicable law or agreed to in writing,
014     ** software distributed under the License is distributed on an
015     ** "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016     ** KIND, either express or implied.  See the License for the
017     ** specific language governing permissions and limitations
018     ** under the License.
019     */
020    package javax.xml.stream.util;
021    
022    import javax.xml.namespace.NamespaceContext;
023    import javax.xml.namespace.QName;
024    import javax.xml.stream.Location;
025    import javax.xml.stream.XMLStreamException;
026    import javax.xml.stream.XMLStreamReader;
027    
028    public class StreamReaderDelegate implements XMLStreamReader {
029            XMLStreamReader reader;
030    
031            public StreamReaderDelegate() {
032            }
033    
034            public StreamReaderDelegate(XMLStreamReader reader) {
035                    this.reader = reader;
036            }
037    
038            public void setParent(XMLStreamReader reader) {
039                    this.reader = reader;
040            }
041    
042            public XMLStreamReader getParent() {
043                    return reader;
044            }
045    
046            public int next() throws XMLStreamException {
047                    return reader.next();
048            }
049    
050            public int nextTag() throws XMLStreamException {
051                    return reader.nextTag();
052            }
053    
054            public String getElementText() throws XMLStreamException {
055                    return reader.getElementText();
056            }
057    
058            public void require(int type, String namespaceURI, String localName)
059                            throws XMLStreamException {
060                    reader.require(type, namespaceURI, localName);
061            }
062    
063            public boolean hasNext() throws XMLStreamException {
064                    return reader.hasNext();
065            }
066    
067            public void close() throws XMLStreamException {
068                    reader.close();
069            }
070    
071            public String getNamespaceURI(String prefix) {
072                    return reader.getNamespaceURI(prefix);
073            }
074    
075            public NamespaceContext getNamespaceContext() {
076                    return reader.getNamespaceContext();
077            }
078    
079            public boolean isStartElement() {
080                    return reader.isStartElement();
081            }
082    
083            public boolean isEndElement() {
084                    return reader.isEndElement();
085            }
086    
087            public boolean isCharacters() {
088                    return reader.isCharacters();
089            }
090    
091            public boolean isWhiteSpace() {
092                    return reader.isWhiteSpace();
093            }
094    
095            public String getAttributeValue(String namespaceURI, String localName) {
096                    return reader.getAttributeValue(namespaceURI, localName);
097            }
098    
099            public int getAttributeCount() {
100                    return reader.getAttributeCount();
101            }
102    
103            public QName getAttributeName(int index) {
104                    return reader.getAttributeName(index);
105            }
106    
107            public String getAttributePrefix(int index) {
108                    return reader.getAttributePrefix(index);
109            }
110    
111            public String getAttributeNamespace(int index) {
112                    return reader.getAttributeNamespace(index);
113            }
114    
115            public String getAttributeLocalName(int index) {
116                    return reader.getAttributeLocalName(index);
117            }
118    
119            public String getAttributeType(int index) {
120                    return reader.getAttributeType(index);
121            }
122    
123            public String getAttributeValue(int index) {
124                    return reader.getAttributeValue(index);
125            }
126    
127            public boolean isAttributeSpecified(int index) {
128                    return reader.isAttributeSpecified(index);
129            }
130    
131            public int getNamespaceCount() {
132                    return reader.getNamespaceCount();
133            }
134    
135            public String getNamespacePrefix(int index) {
136                    return reader.getNamespacePrefix(index);
137            }
138    
139            public String getNamespaceURI(int index) {
140                    return reader.getNamespaceURI(index);
141            }
142    
143            public int getEventType() {
144                    return reader.getEventType();
145            }
146    
147            public String getText() {
148                    return reader.getText();
149            }
150    
151            public int getTextCharacters(int sourceStart, char[] target,
152                            int targetStart, int length) throws XMLStreamException {
153                    return reader.getTextCharacters(sourceStart, target, targetStart,
154                                    length);
155            }
156    
157            public char[] getTextCharacters() {
158                    return reader.getTextCharacters();
159            }
160    
161            public int getTextStart() {
162                    return reader.getTextStart();
163            }
164    
165            public int getTextLength() {
166                    return reader.getTextLength();
167            }
168    
169            public String getEncoding() {
170                    return reader.getEncoding();
171            }
172    
173            public boolean hasText() {
174                    return reader.hasText();
175            }
176    
177            public Location getLocation() {
178                    return reader.getLocation();
179            }
180    
181            public QName getName() {
182                    return reader.getName();
183            }
184    
185            public String getLocalName() {
186                    return reader.getLocalName();
187            }
188    
189            public boolean hasName() {
190                    return reader.hasName();
191            }
192    
193            public String getNamespaceURI() {
194                    return reader.getNamespaceURI();
195            }
196    
197            public String getPrefix() {
198                    return reader.getPrefix();
199            }
200    
201            public String getVersion() {
202                    return reader.getVersion();
203            }
204    
205            public boolean isStandalone() {
206                    return reader.isStandalone();
207            }
208    
209            public boolean standaloneSet() {
210                    return reader.standaloneSet();
211            }
212    
213            public String getCharacterEncodingScheme() {
214                    return reader.getCharacterEncodingScheme();
215            }
216    
217            public String getPITarget() {
218                    return reader.getPITarget();
219            }
220    
221            public String getPIData() {
222                    return reader.getPIData();
223            }
224    
225            public Object getProperty(String name) throws IllegalArgumentException {
226                    return reader.getProperty(name);
227            }
228    }