KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > xml > fastinfoset > stax > StAXParserWrapper


1 /*
2  * Fast Infoset ver. 0.1 software ("Software")
3  *
4  * Copyright, 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
5  *
6  * Software is licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License. You may
8  * obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations.
16  *
17  * Sun supports and benefits from the global community of open source
18  * developers, and thanks the community for its important contributions and
19  * open standards-based technology, which Sun has adopted into many of its
20  * products.
21  *
22  * Please note that portions of Software may be provided with notices and
23  * open source licenses from such communities and third parties that govern the
24  * use of those portions, and any licenses granted hereunder do not alter any
25  * rights and obligations you may have under such open source licenses,
26  * however, the disclaimer of warranty and limitation of liability provisions
27  * in this License will apply to all Software in this distribution.
28  *
29  * You acknowledge that the Software is not designed, licensed or intended
30  * for use in the design, construction, operation or maintenance of any nuclear
31  * facility.
32  *
33  * Apache License
34  * Version 2.0, January 2004
35  * http://www.apache.org/licenses/
36  *
37  */

38
39 package com.sun.xml.fastinfoset.stax;
40 import javax.xml.namespace.QName JavaDoc;
41 import javax.xml.namespace.NamespaceContext JavaDoc;
42
43 import javax.xml.stream.events.XMLEvent;
44 import javax.xml.stream.XMLStreamReader;
45 import javax.xml.stream.Location;
46 import javax.xml.stream.XMLStreamException;
47 import java.util.List JavaDoc;
48 import java.io.InputStream JavaDoc;
49
50
51 public class StAXParserWrapper implements XMLStreamReader{
52     private XMLStreamReader _reader;
53     
54     /** Creates a new instance of StAXParserWrapper */
55     public StAXParserWrapper() {
56     }
57
58     public StAXParserWrapper(XMLStreamReader reader) {
59         _reader = reader;
60     }
61     public void setReader(XMLStreamReader reader) {
62         _reader = reader;
63     }
64     public XMLStreamReader getReader() {
65         return _reader;
66     }
67
68     public int next() throws XMLStreamException
69     {
70         return _reader.next();
71     }
72
73     public int nextTag() throws XMLStreamException
74     {
75         return _reader.nextTag();
76     }
77
78     public String JavaDoc getElementText() throws XMLStreamException
79     {
80         return _reader.getElementText();
81     }
82
83     public void require(int type, String JavaDoc namespaceURI, String JavaDoc localName) throws XMLStreamException
84     {
85         _reader.require(type,namespaceURI,localName);
86     }
87
88     public boolean hasNext() throws XMLStreamException
89     {
90         return _reader.hasNext();
91     }
92
93     public void close() throws XMLStreamException
94     {
95         _reader.close();
96     }
97
98     public String JavaDoc getNamespaceURI(String JavaDoc prefix)
99     {
100         return _reader.getNamespaceURI(prefix);
101     }
102
103     public NamespaceContext JavaDoc getNamespaceContext() {
104         return _reader.getNamespaceContext();
105     }
106
107     public boolean isStartElement() {
108         return _reader.isStartElement();
109     }
110
111     public boolean isEndElement() {
112         return _reader.isEndElement();
113     }
114
115     public boolean isCharacters() {
116     return _reader.isCharacters();
117     }
118
119     public boolean isWhiteSpace() {
120         return _reader.isWhiteSpace();
121     }
122
123     public QName JavaDoc getAttributeName(int index) {
124         return _reader.getAttributeName(index);
125     }
126
127     public int getTextCharacters(int sourceStart, char[] target, int targetStart,
128                                int length) throws XMLStreamException
129     {
130         return _reader.getTextCharacters(sourceStart, target, targetStart, length);
131     }
132
133     public String JavaDoc getAttributeValue(String JavaDoc namespaceUri,
134                                   String JavaDoc localName)
135     {
136         return _reader.getAttributeValue(namespaceUri,localName);
137     }
138     public int getAttributeCount() {
139         return _reader.getAttributeCount();
140     }
141     public String JavaDoc getAttributePrefix(int index) {
142         return _reader.getAttributePrefix(index);
143     }
144     public String JavaDoc getAttributeNamespace(int index) {
145         return _reader.getAttributeNamespace(index);
146     }
147     public String JavaDoc getAttributeLocalName(int index) {
148         return _reader.getAttributeLocalName(index);
149     }
150     public String JavaDoc getAttributeType(int index) {
151         return _reader.getAttributeType(index);
152     }
153     public String JavaDoc getAttributeValue(int index) {
154         return _reader.getAttributeValue(index);
155     }
156     public boolean isAttributeSpecified(int index) {
157         return _reader.isAttributeSpecified(index);
158     }
159
160     public int getNamespaceCount() {
161         return _reader.getNamespaceCount();
162     }
163     public String JavaDoc getNamespacePrefix(int index) {
164         return _reader.getNamespacePrefix(index);
165     }
166     public String JavaDoc getNamespaceURI(int index) {
167         return _reader.getNamespaceURI(index);
168     }
169
170     public int getEventType() {
171         return _reader.getEventType();
172     }
173
174     public String JavaDoc getText() {
175         return _reader.getText();
176     }
177
178     public char[] getTextCharacters() {
179         return _reader.getTextCharacters();
180     }
181
182     public int getTextStart() {
183         return _reader.getTextStart();
184     }
185
186     public int getTextLength() {
187         return _reader.getTextLength();
188     }
189
190     public String JavaDoc getEncoding() {
191         return _reader.getEncoding();
192     }
193
194     public boolean hasText() {
195         return _reader.hasText();
196     }
197
198     public Location getLocation() {
199         return _reader.getLocation();
200     }
201
202     public QName JavaDoc getName() {
203         return _reader.getName();
204     }
205
206     public String JavaDoc getLocalName() {
207         return _reader.getLocalName();
208     }
209
210     public boolean hasName() {
211         return _reader.hasName();
212     }
213
214     public String JavaDoc getNamespaceURI() {
215         return _reader.getNamespaceURI();
216     }
217
218     public String JavaDoc getPrefix() {
219         return _reader.getPrefix();
220     }
221
222     public String JavaDoc getVersion() {
223         return _reader.getVersion();
224     }
225
226     public boolean isStandalone() {
227         return _reader.isStandalone();
228     }
229
230     public boolean standaloneSet() {
231         return _reader.standaloneSet();
232     }
233
234     public String JavaDoc getCharacterEncodingScheme() {
235         return _reader.getCharacterEncodingScheme();
236     }
237
238     public String JavaDoc getPITarget() {
239         return _reader.getPITarget();
240     }
241
242     public String JavaDoc getPIData() {
243         return _reader.getPIData();
244     }
245
246     public Object JavaDoc getProperty(String JavaDoc name) {
247         return _reader.getProperty(name);
248     }
249 }
250
Popular Tags