01: package com.sun.codemodel.writer;
02:
03: import java.io.OutputStream;
04: import java.io.IOException;
05: import java.io.Writer;
06:
07: import com.sun.codemodel.CodeWriter;
08: import com.sun.codemodel.JPackage;
09:
10: /**
11: * {@link CodeWriter} that delegates to another {@link CodeWriter}.
12: *
13: * @author Kohsuke Kawaguchi
14: */
15: public class FilterCodeWriter extends CodeWriter {
16: protected CodeWriter core;
17:
18: public FilterCodeWriter(CodeWriter core) {
19: this .core = core;
20: }
21:
22: public OutputStream openBinary(JPackage pkg, String fileName)
23: throws IOException {
24: return core.openBinary(pkg, fileName);
25: }
26:
27: public Writer openSource(JPackage pkg, String fileName)
28: throws IOException {
29: return core.openSource(pkg, fileName);
30: }
31:
32: public void close() throws IOException {
33: core.close();
34: }
35: }
|