KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.thoughtworks.xstream.io;
2
3 /**
4  * Base class to make it easy to create wrappers (decorators) for HierarchicalStreamWriter.
5  *
6  * @author Joe Walnes
7  */

8 public abstract class WriterWrapper implements HierarchicalStreamWriter {
9
10     protected HierarchicalStreamWriter wrapped;
11
12     protected WriterWrapper(HierarchicalStreamWriter wrapped) {
13         this.wrapped = wrapped;
14     }
15
16     public void startNode(String JavaDoc name) {
17         wrapped.startNode(name);
18     }
19
20     public void endNode() {
21         wrapped.endNode();
22     }
23
24     public void addAttribute(String JavaDoc key, String JavaDoc value) {
25         wrapped.addAttribute(key, value);
26     }
27
28     public void setValue(String JavaDoc text) {
29         wrapped.setValue(text);
30     }
31
32     public void flush() {
33         wrapped.flush();
34     }
35
36     public void close() {
37         wrapped.close();
38     }
39
40     public HierarchicalStreamWriter underlyingWriter() {
41         return wrapped.underlyingWriter();
42     }
43
44 }
45
Popular Tags