1 | package org.springframework.batch.item.xml.stax; |
2 | |
3 | import javax.xml.stream.XMLEventReader; |
4 | import javax.xml.stream.XMLStreamException; |
5 | import javax.xml.stream.events.XMLEvent; |
6 | |
7 | /** |
8 | * Delegates all functionality to the wrapped reader allowing |
9 | * subclasses to override only the methods they want to change. |
10 | * |
11 | * @author Robert Kasanicky |
12 | */ |
13 | abstract class AbstractEventReaderWrapper implements XMLEventReader { |
14 | |
15 | protected XMLEventReader wrappedEventReader; |
16 | |
17 | public AbstractEventReaderWrapper(XMLEventReader wrappedEventReader) { |
18 | this.wrappedEventReader = wrappedEventReader; |
19 | } |
20 | |
21 | public void close() throws XMLStreamException { |
22 | wrappedEventReader.close(); |
23 | |
24 | } |
25 | |
26 | public String getElementText() throws XMLStreamException { |
27 | return wrappedEventReader.getElementText(); |
28 | } |
29 | |
30 | public Object getProperty(String name) throws IllegalArgumentException { |
31 | return wrappedEventReader.getProperty(name); |
32 | } |
33 | |
34 | public boolean hasNext() { |
35 | return wrappedEventReader.hasNext(); |
36 | } |
37 | |
38 | public XMLEvent nextEvent() throws XMLStreamException { |
39 | return wrappedEventReader.nextEvent(); |
40 | } |
41 | |
42 | public XMLEvent nextTag() throws XMLStreamException { |
43 | return wrappedEventReader.nextTag(); |
44 | } |
45 | |
46 | public XMLEvent peek() throws XMLStreamException { |
47 | return wrappedEventReader.peek(); |
48 | } |
49 | |
50 | public Object next() { |
51 | return wrappedEventReader.next(); |
52 | } |
53 | |
54 | public void remove() { |
55 | wrappedEventReader.remove(); |
56 | } |
57 | |
58 | } |