KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > stream > util > StreamReaderDelegate


1 package javax.xml.stream.util;
2
3 import java.io.Reader JavaDoc;
4 import javax.xml.namespace.QName JavaDoc;
5 import javax.xml.namespace.NamespaceContext JavaDoc;
6 import javax.xml.stream.XMLStreamReader;
7 import javax.xml.stream.Location;
8 import javax.xml.stream.XMLStreamException;
9
10 /**
11  * This is the base class for deriving an XMLStreamReader filter
12  *
13  * This class is designed to sit between an XMLStreamReader and an
14  * application's XMLStreamReader. By default each method
15  * does nothing but call the corresponding method on the
16  * parent interface.
17  *
18  * @version 1.0
19  * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
20  * @see javax.xml.stream.XMLStreamReader
21  * @see EventReaderDelegate
22  * @since 1.6
23  */

24
25 public class StreamReaderDelegate implements XMLStreamReader {
26   private XMLStreamReader reader;
27
28   /**
29    * Construct an empty filter with no parent.
30    */

31   public StreamReaderDelegate(){}
32
33   /**
34    * Construct an filter with the specified parent.
35    * @param reader the parent
36    */

37   public StreamReaderDelegate(XMLStreamReader reader) {
38     this.reader = reader;
39   }
40
41   /**
42    * Set the parent of this instance.
43    * @param reader the new parent
44    */

45   public void setParent(XMLStreamReader reader) {
46     this.reader = reader;
47   }
48
49   /**
50    * Get the parent of this instance.
51    * @return the parent or null if none is set
52    */

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