View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.shared_orchestra.context;
20  
21  import javax.faces.component.UIComponent;
22  import javax.faces.context.ResponseWriter;
23  import java.io.IOException;
24  import java.io.Writer;
25  
26  /**
27   * Convenient base class for writing a ResponseWriter wrapper class.
28   *
29   * @author Manfred Geiler
30   */
31  public abstract class ResponseWriterWrapper
32          extends ResponseWriter
33  {
34      protected ResponseWriter _responseWriter;
35  
36      public ResponseWriterWrapper(ResponseWriter responseWriter)
37      {
38          _responseWriter = responseWriter;
39      }
40  
41      public String getContentType()
42      {
43          return _responseWriter.getContentType();
44      }
45  
46      public String getCharacterEncoding()
47      {
48          return _responseWriter.getCharacterEncoding();
49      }
50  
51      public void flush() throws IOException
52      {
53          _responseWriter.flush();
54      }
55  
56      public void startDocument() throws IOException
57      {
58          _responseWriter.startDocument();
59      }
60  
61      public void endDocument() throws IOException
62      {
63          _responseWriter.endDocument();
64      }
65  
66      public void startElement(String s, UIComponent uicomponent) throws IOException
67      {
68          _responseWriter.startElement(s, uicomponent);
69      }
70  
71      public void endElement(String s) throws IOException
72      {
73          _responseWriter.endElement(s);
74      }
75  
76      public void writeAttribute(String s, Object obj, String s1) throws IOException
77      {
78          _responseWriter.writeAttribute(s, obj, s1);
79      }
80  
81      public void writeURIAttribute(String s, Object obj, String s1) throws IOException
82      {
83          _responseWriter.writeURIAttribute(s, obj, s1);
84      }
85  
86      public void writeComment(Object obj) throws IOException
87      {
88          _responseWriter.writeComment(obj);
89      }
90  
91      public void writeText(Object obj, String s) throws IOException
92      {
93          _responseWriter.writeText(obj, s);
94      }
95  
96      public void writeText(char ac[], int i, int j) throws IOException
97      {
98          _responseWriter.writeText(ac, i, j);
99      }
100 
101     public abstract ResponseWriter cloneWithWriter(Writer writer);
102 
103     public void close() throws IOException
104     {
105         _responseWriter.close();
106     }
107 
108     public void write(char cbuf[], int off, int len) throws IOException
109     {
110         _responseWriter.write(cbuf, off, len);
111     }
112 
113     public void write(int c) throws IOException
114     {
115         _responseWriter.write(c);
116     }
117 
118     public void write(char cbuf[]) throws IOException
119     {
120         _responseWriter.write(cbuf);
121     }
122 
123     public void write(String str) throws IOException
124     {
125         _responseWriter.write(str);
126     }
127 
128     public void write(String str, int off, int len) throws IOException
129     {
130         _responseWriter.write(str, off, len);
131     }
132 }