001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: *
025: * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
026: */
027:
028: /*
029: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
030: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
031: *
032: * This code is free software; you can redistribute it and/or modify it
033: * under the terms of the GNU General Public License version 2 only, as
034: * published by the Free Software Foundation. Sun designates this
035: * particular file as subject to the "Classpath" exception as provided
036: * by Sun in the LICENSE file that accompanied this code.
037: *
038: * This code is distributed in the hope that it will be useful, but WITHOUT
039: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
040: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
041: * version 2 for more details (a copy is included in the LICENSE file that
042: * accompanied this code).
043: *
044: * You should have received a copy of the GNU General Public License version
045: * 2 along with this work; if not, write to the Free Software Foundation,
046: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
047: *
048: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
049: * CA 95054 USA or visit www.sun.com if you need additional information or
050: * have any questions.
051: *
052: * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
053: *
054: */
055:
056: package com.sun.xml.internal.fastinfoset.stax.util;
057:
058: import javax.xml.namespace.QName;
059: import javax.xml.namespace.NamespaceContext;
060:
061: import javax.xml.stream.XMLStreamReader;
062: import javax.xml.stream.Location;
063: import javax.xml.stream.XMLStreamException;
064:
065: public class StAXParserWrapper implements XMLStreamReader {
066: private XMLStreamReader _reader;
067:
068: /** Creates a new instance of StAXParserWrapper */
069: public StAXParserWrapper() {
070: }
071:
072: public StAXParserWrapper(XMLStreamReader reader) {
073: _reader = reader;
074: }
075:
076: public void setReader(XMLStreamReader reader) {
077: _reader = reader;
078: }
079:
080: public XMLStreamReader getReader() {
081: return _reader;
082: }
083:
084: public int next() throws XMLStreamException {
085: return _reader.next();
086: }
087:
088: public int nextTag() throws XMLStreamException {
089: return _reader.nextTag();
090: }
091:
092: public String getElementText() throws XMLStreamException {
093: return _reader.getElementText();
094: }
095:
096: public void require(int type, String namespaceURI, String localName)
097: throws XMLStreamException {
098: _reader.require(type, namespaceURI, localName);
099: }
100:
101: public boolean hasNext() throws XMLStreamException {
102: return _reader.hasNext();
103: }
104:
105: public void close() throws XMLStreamException {
106: _reader.close();
107: }
108:
109: public String getNamespaceURI(String prefix) {
110: return _reader.getNamespaceURI(prefix);
111: }
112:
113: public NamespaceContext getNamespaceContext() {
114: return _reader.getNamespaceContext();
115: }
116:
117: public boolean isStartElement() {
118: return _reader.isStartElement();
119: }
120:
121: public boolean isEndElement() {
122: return _reader.isEndElement();
123: }
124:
125: public boolean isCharacters() {
126: return _reader.isCharacters();
127: }
128:
129: public boolean isWhiteSpace() {
130: return _reader.isWhiteSpace();
131: }
132:
133: public QName getAttributeName(int index) {
134: return _reader.getAttributeName(index);
135: }
136:
137: public int getTextCharacters(int sourceStart, char[] target,
138: int targetStart, int length) throws XMLStreamException {
139: return _reader.getTextCharacters(sourceStart, target,
140: targetStart, length);
141: }
142:
143: public String getAttributeValue(String namespaceUri,
144: String localName) {
145: return _reader.getAttributeValue(namespaceUri, localName);
146: }
147:
148: public int getAttributeCount() {
149: return _reader.getAttributeCount();
150: }
151:
152: public String getAttributePrefix(int index) {
153: return _reader.getAttributePrefix(index);
154: }
155:
156: public String getAttributeNamespace(int index) {
157: return _reader.getAttributeNamespace(index);
158: }
159:
160: public String getAttributeLocalName(int index) {
161: return _reader.getAttributeLocalName(index);
162: }
163:
164: public String getAttributeType(int index) {
165: return _reader.getAttributeType(index);
166: }
167:
168: public String getAttributeValue(int index) {
169: return _reader.getAttributeValue(index);
170: }
171:
172: public boolean isAttributeSpecified(int index) {
173: return _reader.isAttributeSpecified(index);
174: }
175:
176: public int getNamespaceCount() {
177: return _reader.getNamespaceCount();
178: }
179:
180: public String getNamespacePrefix(int index) {
181: return _reader.getNamespacePrefix(index);
182: }
183:
184: public String getNamespaceURI(int index) {
185: return _reader.getNamespaceURI(index);
186: }
187:
188: public int getEventType() {
189: return _reader.getEventType();
190: }
191:
192: public String getText() {
193: return _reader.getText();
194: }
195:
196: public char[] getTextCharacters() {
197: return _reader.getTextCharacters();
198: }
199:
200: public int getTextStart() {
201: return _reader.getTextStart();
202: }
203:
204: public int getTextLength() {
205: return _reader.getTextLength();
206: }
207:
208: public String getEncoding() {
209: return _reader.getEncoding();
210: }
211:
212: public boolean hasText() {
213: return _reader.hasText();
214: }
215:
216: public Location getLocation() {
217: return _reader.getLocation();
218: }
219:
220: public QName getName() {
221: return _reader.getName();
222: }
223:
224: public String getLocalName() {
225: return _reader.getLocalName();
226: }
227:
228: public boolean hasName() {
229: return _reader.hasName();
230: }
231:
232: public String getNamespaceURI() {
233: return _reader.getNamespaceURI();
234: }
235:
236: public String getPrefix() {
237: return _reader.getPrefix();
238: }
239:
240: public String getVersion() {
241: return _reader.getVersion();
242: }
243:
244: public boolean isStandalone() {
245: return _reader.isStandalone();
246: }
247:
248: public boolean standaloneSet() {
249: return _reader.standaloneSet();
250: }
251:
252: public String getCharacterEncodingScheme() {
253: return _reader.getCharacterEncodingScheme();
254: }
255:
256: public String getPITarget() {
257: return _reader.getPITarget();
258: }
259:
260: public String getPIData() {
261: return _reader.getPIData();
262: }
263:
264: public Object getProperty(String name) {
265: return _reader.getProperty(name);
266: }
267: }
|