1/*
2 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 *
25 * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
26 */
27
28package com.sun.xml.internal.fastinfoset.stax.util;
29
30import javax.xml.namespace.QName;
31import javax.xml.namespace.NamespaceContext;
32
33import javax.xml.stream.XMLStreamReader;
34import javax.xml.stream.Location;
35import javax.xml.stream.XMLStreamException;
36
37
38public class StAXParserWrapper implements XMLStreamReader{
39    private XMLStreamReader _reader;
40
41    /** Creates a new instance of StAXParserWrapper */
42    public StAXParserWrapper() {
43    }
44
45    public StAXParserWrapper(XMLStreamReader reader) {
46        _reader = reader;
47    }
48    public void setReader(XMLStreamReader reader) {
49        _reader = reader;
50    }
51    public XMLStreamReader getReader() {
52        return _reader;
53    }
54
55    public int next() throws XMLStreamException
56    {
57        return _reader.next();
58    }
59
60    public int nextTag() throws XMLStreamException
61    {
62        return _reader.nextTag();
63    }
64
65    public String getElementText() throws XMLStreamException
66    {
67        return _reader.getElementText();
68    }
69
70    public void require(int type, String namespaceURI, String localName) throws XMLStreamException
71    {
72        _reader.require(type,namespaceURI,localName);
73    }
74
75    public boolean hasNext() throws XMLStreamException
76    {
77        return _reader.hasNext();
78    }
79
80    public void close() throws XMLStreamException
81    {
82        _reader.close();
83    }
84
85    public String getNamespaceURI(String prefix)
86    {
87        return _reader.getNamespaceURI(prefix);
88    }
89
90    public NamespaceContext getNamespaceContext() {
91        return _reader.getNamespaceContext();
92    }
93
94    public boolean isStartElement() {
95        return _reader.isStartElement();
96    }
97
98    public boolean isEndElement() {
99        return _reader.isEndElement();
100    }
101
102    public boolean isCharacters() {
103    return _reader.isCharacters();
104    }
105
106    public boolean isWhiteSpace() {
107        return _reader.isWhiteSpace();
108    }
109
110    public QName getAttributeName(int index) {
111        return _reader.getAttributeName(index);
112    }
113
114    public int getTextCharacters(int sourceStart, char[] target, int targetStart,
115                               int length) throws XMLStreamException
116    {
117        return _reader.getTextCharacters(sourceStart, target, targetStart, length);
118    }
119
120    public String getAttributeValue(String namespaceUri,
121                                  String localName)
122    {
123        return _reader.getAttributeValue(namespaceUri,localName);
124    }
125    public int getAttributeCount() {
126        return _reader.getAttributeCount();
127    }
128    public String getAttributePrefix(int index) {
129        return _reader.getAttributePrefix(index);
130    }
131    public String getAttributeNamespace(int index) {
132        return _reader.getAttributeNamespace(index);
133    }
134    public String getAttributeLocalName(int index) {
135        return _reader.getAttributeLocalName(index);
136    }
137    public String getAttributeType(int index) {
138        return _reader.getAttributeType(index);
139    }
140    public String getAttributeValue(int index) {
141        return _reader.getAttributeValue(index);
142    }
143    public boolean isAttributeSpecified(int index) {
144        return _reader.isAttributeSpecified(index);
145    }
146
147    public int getNamespaceCount() {
148        return _reader.getNamespaceCount();
149    }
150    public String getNamespacePrefix(int index) {
151        return _reader.getNamespacePrefix(index);
152    }
153    public String getNamespaceURI(int index) {
154        return _reader.getNamespaceURI(index);
155    }
156
157    public int getEventType() {
158        return _reader.getEventType();
159    }
160
161    public String getText() {
162        return _reader.getText();
163    }
164
165    public char[] getTextCharacters() {
166        return _reader.getTextCharacters();
167    }
168
169    public int getTextStart() {
170        return _reader.getTextStart();
171    }
172
173    public int getTextLength() {
174        return _reader.getTextLength();
175    }
176
177    public String getEncoding() {
178        return _reader.getEncoding();
179    }
180
181    public boolean hasText() {
182        return _reader.hasText();
183    }
184
185    public Location getLocation() {
186        return _reader.getLocation();
187    }
188
189    public QName getName() {
190        return _reader.getName();
191    }
192
193    public String getLocalName() {
194        return _reader.getLocalName();
195    }
196
197    public boolean hasName() {
198        return _reader.hasName();
199    }
200
201    public String getNamespaceURI() {
202        return _reader.getNamespaceURI();
203    }
204
205    public String getPrefix() {
206        return _reader.getPrefix();
207    }
208
209    public String getVersion() {
210        return _reader.getVersion();
211    }
212
213    public boolean isStandalone() {
214        return _reader.isStandalone();
215    }
216
217    public boolean standaloneSet() {
218        return _reader.standaloneSet();
219    }
220
221    public String getCharacterEncodingScheme() {
222        return _reader.getCharacterEncodingScheme();
223    }
224
225    public String getPITarget() {
226        return _reader.getPITarget();
227    }
228
229    public String getPIData() {
230        return _reader.getPIData();
231    }
232
233    public Object getProperty(String name) {
234        return _reader.getProperty(name);
235    }
236}
237