KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > io > ReaderWrapper


1 package com.thoughtworks.xstream.io;
2
3 import com.thoughtworks.xstream.converters.ErrorWriter;
4
5 import java.util.Iterator JavaDoc;
6
7 /**
8  * Base class to make it easy to create wrappers (decorators) for HierarchicalStreamReader.
9  *
10  * @author Joe Walnes
11  */

12 public abstract class ReaderWrapper implements HierarchicalStreamReader {
13
14     protected HierarchicalStreamReader wrapped;
15
16     protected ReaderWrapper(HierarchicalStreamReader reader) {
17         this.wrapped = reader;
18     }
19
20     public boolean hasMoreChildren() {
21         return wrapped.hasMoreChildren();
22     }
23
24     public void moveDown() {
25         wrapped.moveDown();
26     }
27
28     public void moveUp() {
29         wrapped.moveUp();
30     }
31
32     public String JavaDoc getNodeName() {
33         return wrapped.getNodeName();
34     }
35
36     public String JavaDoc getValue() {
37         return wrapped.getValue();
38     }
39
40     public String JavaDoc getAttribute(String JavaDoc name) {
41         return wrapped.getAttribute(name);
42     }
43
44     public String JavaDoc getAttribute(int index) {
45         return wrapped.getAttribute(index);
46     }
47
48     public int getAttributeCount() {
49         return wrapped.getAttributeCount();
50     }
51
52     public String JavaDoc getAttributeName(int index) {
53         return wrapped.getAttributeName(index);
54     }
55
56     public Iterator JavaDoc getAttributeNames() {
57         return wrapped.getAttributeNames();
58     }
59
60     public Object JavaDoc peekUnderlyingNode() {
61         return wrapped.peekUnderlyingNode();
62     }
63
64     public void appendErrors(ErrorWriter errorWriter) {
65         wrapped.appendErrors(errorWriter);
66     }
67
68     public void close() {
69         wrapped.close();
70     }
71
72     public HierarchicalStreamReader underlyingReader() {
73         return wrapped.underlyingReader();
74     }
75 }
76
Popular Tags