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