src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderFilter.java

Tue, 06 Mar 2012 16:09:35 -0800

author
ohair
date
Tue, 06 Mar 2012 16:09:35 -0800
changeset 286
f50545b5e2f1
child 368
0989ad8c0860
permissions
-rw-r--r--

7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom

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

mercurial