Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/javax/xml/stream/util/EventReaderDelegate.java
48576 views
1
/*
2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
*
4
* This code is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 only, as
6
* published by the Free Software Foundation. Oracle designates this
7
* particular file as subject to the "Classpath" exception as provided
8
* by Oracle in the LICENSE file that accompanied this code.
9
*
10
* This code is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* version 2 for more details (a copy is included in the LICENSE file that
14
* accompanied this code).
15
*
16
* You should have received a copy of the GNU General Public License version
17
* 2 along with this work; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
*
20
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
* or visit www.oracle.com if you need additional information or have any
22
* questions.
23
*/
24
25
/*
26
* Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
27
*/
28
29
package javax.xml.stream.util;
30
31
import javax.xml.namespace.QName;
32
import javax.xml.namespace.NamespaceContext;
33
import javax.xml.stream.XMLEventReader;
34
import javax.xml.stream.events.XMLEvent;
35
import javax.xml.stream.Location;
36
import javax.xml.stream.XMLStreamException;
37
38
/**
39
* This is the base class for deriving an XMLEventReader
40
* filter.
41
*
42
* This class is designed to sit between an XMLEventReader and an
43
* application's XMLEventReader. By default each method
44
* does nothing but call the corresponding method on the
45
* parent interface.
46
*
47
* @version 1.0
48
* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
49
* @see javax.xml.stream.XMLEventReader
50
* @see StreamReaderDelegate
51
* @since 1.6
52
*/
53
54
public class EventReaderDelegate implements XMLEventReader {
55
private XMLEventReader reader;
56
57
/**
58
* Construct an empty filter with no parent.
59
*/
60
public EventReaderDelegate(){}
61
62
/**
63
* Construct an filter with the specified parent.
64
* @param reader the parent
65
*/
66
public EventReaderDelegate(XMLEventReader reader) {
67
this.reader = reader;
68
}
69
70
/**
71
* Set the parent of this instance.
72
* @param reader the new parent
73
*/
74
public void setParent(XMLEventReader reader) {
75
this.reader = reader;
76
}
77
78
/**
79
* Get the parent of this instance.
80
* @return the parent or null if none is set
81
*/
82
public XMLEventReader getParent() {
83
return reader;
84
}
85
86
public XMLEvent nextEvent()
87
throws XMLStreamException
88
{
89
return reader.nextEvent();
90
}
91
92
public Object next() {
93
return reader.next();
94
}
95
96
public boolean hasNext()
97
{
98
return reader.hasNext();
99
}
100
101
public XMLEvent peek()
102
throws XMLStreamException
103
{
104
return reader.peek();
105
}
106
107
public void close()
108
throws XMLStreamException
109
{
110
reader.close();
111
}
112
113
public String getElementText()
114
throws XMLStreamException
115
{
116
return reader.getElementText();
117
}
118
119
public XMLEvent nextTag()
120
throws XMLStreamException
121
{
122
return reader.nextTag();
123
}
124
125
public Object getProperty(java.lang.String name)
126
throws java.lang.IllegalArgumentException
127
{
128
return reader.getProperty(name);
129
}
130
131
public void remove() {
132
reader.remove();
133
}
134
}
135
136