001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029:
030: package javax.xml.stream.util;
031:
032: import javax.xml.namespace.NamespaceContext;
033: import javax.xml.namespace.QName;
034: import javax.xml.stream.Location;
035: import javax.xml.stream.XMLStreamException;
036: import javax.xml.stream.XMLStreamReader;
037:
038: /**
039: * Wrapper around an XMLStreamReader
040: */
041: public class StreamReaderDelegate implements XMLStreamReader {
042:
043: private XMLStreamReader _parent;
044:
045: public StreamReaderDelegate() {
046: this (null);
047: }
048:
049: public StreamReaderDelegate(XMLStreamReader reader) {
050: _parent = reader;
051: }
052:
053: public void close() throws XMLStreamException {
054: _parent.close();
055: }
056:
057: public int getAttributeCount() {
058: return _parent.getAttributeCount();
059: }
060:
061: public String getAttributeLocalName(int index) {
062: return _parent.getAttributeLocalName(index);
063: }
064:
065: public QName getAttributeName(int index) {
066: return _parent.getAttributeName(index);
067: }
068:
069: public String getAttributeNamespace(int index) {
070: return _parent.getAttributeNamespace(index);
071: }
072:
073: public String getAttributePrefix(int index) {
074: return _parent.getAttributePrefix(index);
075: }
076:
077: public String getAttributeType(int index) {
078: return _parent.getAttributeType(index);
079: }
080:
081: public String getAttributeValue(int index) {
082: return _parent.getAttributeValue(index);
083: }
084:
085: public String getAttributeValue(String namespaceUri,
086: String localName) {
087: return _parent.getAttributeValue(namespaceUri, localName);
088: }
089:
090: public String getCharacterEncodingScheme() {
091: return _parent.getCharacterEncodingScheme();
092: }
093:
094: public String getElementText() throws XMLStreamException {
095: return _parent.getElementText();
096: }
097:
098: public String getEncoding() {
099: return _parent.getEncoding();
100: }
101:
102: public int getEventType() {
103: return _parent.getEventType();
104: }
105:
106: public String getLocalName() {
107: return _parent.getLocalName();
108: }
109:
110: public Location getLocation() {
111: return _parent.getLocation();
112: }
113:
114: public QName getName() {
115: return _parent.getName();
116: }
117:
118: public NamespaceContext getNamespaceContext() {
119: return _parent.getNamespaceContext();
120: }
121:
122: public int getNamespaceCount() {
123: return _parent.getNamespaceCount();
124: }
125:
126: public String getNamespacePrefix(int index) {
127: return _parent.getNamespacePrefix(index);
128: }
129:
130: public String getNamespaceURI() {
131: return _parent.getNamespaceURI();
132: }
133:
134: public String getNamespaceURI(int index) {
135: return _parent.getNamespaceURI(index);
136: }
137:
138: public String getNamespaceURI(String prefix) {
139: return _parent.getNamespaceURI(prefix);
140: }
141:
142: public XMLStreamReader getParent() {
143: return _parent;
144: }
145:
146: public String getPIData() {
147: return _parent.getPIData();
148: }
149:
150: public String getPITarget() {
151: return _parent.getPITarget();
152: }
153:
154: public String getPrefix() {
155: return _parent.getPrefix();
156: }
157:
158: public Object getProperty(String name) {
159: return _parent.getProperty(name);
160: }
161:
162: public String getText() {
163: return _parent.getText();
164: }
165:
166: public char[] getTextCharacters() {
167: return _parent.getTextCharacters();
168: }
169:
170: public int getTextCharacters(int sourceStart, char[] target,
171: int targetStart, int length) throws XMLStreamException {
172: return _parent.getTextCharacters(sourceStart, target,
173: targetStart, length);
174: }
175:
176: public int getTextLength() {
177: return _parent.getTextLength();
178: }
179:
180: public int getTextStart() {
181: return _parent.getTextStart();
182: }
183:
184: public String getVersion() {
185: return _parent.getVersion();
186: }
187:
188: public boolean hasName() {
189: return _parent.hasName();
190: }
191:
192: public boolean hasNext() throws XMLStreamException {
193: return _parent.hasNext();
194: }
195:
196: public boolean hasText() {
197: return _parent.hasText();
198: }
199:
200: public boolean isAttributeSpecified(int index) {
201: return _parent.isAttributeSpecified(index);
202: }
203:
204: public boolean isCharacters() {
205: return _parent.isCharacters();
206: }
207:
208: public boolean isEndElement() {
209: return _parent.isEndElement();
210: }
211:
212: public boolean isStandalone() {
213: return _parent.isStandalone();
214: }
215:
216: public boolean isStartElement() {
217: return _parent.isStartElement();
218: }
219:
220: public boolean isWhiteSpace() {
221: return _parent.isWhiteSpace();
222: }
223:
224: public int next() throws XMLStreamException {
225: return _parent.next();
226: }
227:
228: public int nextTag() throws XMLStreamException {
229: return _parent.nextTag();
230: }
231:
232: public void require(int type, String namespaceURI, String localName)
233: throws XMLStreamException {
234: _parent.require(type, namespaceURI, localName);
235: }
236:
237: public void setParent(XMLStreamReader reader) {
238: _parent = reader;
239: }
240:
241: public boolean standaloneSet() {
242: return _parent.standaloneSet();
243: }
244:
245: }
|