KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icesoft > faces > webapp > parser > JspWriterImpl


1 /*
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * "The contents of this file are subject to the Mozilla Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11  * License for the specific language governing rights and limitations under
12  * the License.
13  *
14  * The Original Code is ICEfaces 1.5 open source software code, released
15  * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
16  * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
17  * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
18  *
19  * Contributor(s): _____________________.
20  *
21  * Alternatively, the contents of this file may be used under the terms of
22  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
23  * License), in which case the provisions of the LGPL License are
24  * applicable instead of those above. If you wish to allow use of your
25  * version of this file only under the terms of the LGPL License and not to
26  * allow others to use your version of this file under the MPL, indicate
27  * your decision by deleting the provisions above and replace them with
28  * the notice and other provisions required by the LGPL License. If you do
29  * not delete the provisions above, a recipient may use your version of
30  * this file under either the MPL or the LGPL License."
31  *
32  */

33
34 package com.icesoft.faces.webapp.parser;
35
36 import javax.servlet.jsp.JspWriter JavaDoc;
37 import java.io.IOException JavaDoc;
38 import java.io.Writer JavaDoc;
39
40 //Stubbed-out class for debugging tags that write to the body
41

42 public class JspWriterImpl extends JspWriter JavaDoc {
43
44     private Writer JavaDoc out;
45
46     public JspWriterImpl(Writer JavaDoc out) {
47         super(2000, true);
48         this.out = out;
49     }
50
51     public final void clear() throws IOException JavaDoc {
52     }
53
54     public void clearBuffer() throws IOException JavaDoc {
55     }
56
57     public void flush() throws IOException JavaDoc {
58         if (null != out) {
59             out.flush();
60         }
61     }
62
63     public void close() throws IOException JavaDoc {
64         if (null != out) {
65             out.close();
66         }
67         out = null;
68     }
69
70     public int getRemaining() {
71         return 2000;
72     }
73
74
75     public void write(int c) throws IOException JavaDoc {
76         out.write(c);
77     }
78
79     public void write(char cbuf[], int off, int len)
80             throws IOException JavaDoc {
81         out.write(cbuf, off, len);
82
83     }
84
85
86     public void write(char buf[]) throws IOException JavaDoc {
87         write(buf, 0, buf.length);
88     }
89
90
91     public void write(String JavaDoc s, int off, int len) throws IOException JavaDoc {
92         out.write(s, off, len);
93     }
94
95     public void write(String JavaDoc s) throws IOException JavaDoc {
96         write(s, 0, s.length());
97     }
98
99     static String JavaDoc lineSeparator = System.getProperty("line.separator");
100
101     public void newLine() throws IOException JavaDoc {
102         write(lineSeparator);
103     }
104
105     public void print(boolean b) throws IOException JavaDoc {
106         write(b ? "true" : "false");
107     }
108
109     public void print(char c) throws IOException JavaDoc {
110         write(String.valueOf(c));
111     }
112
113     public void print(int i) throws IOException JavaDoc {
114         write(String.valueOf(i));
115     }
116
117     public void print(long l) throws IOException JavaDoc {
118         write(String.valueOf(l));
119     }
120
121     public void print(float f) throws IOException JavaDoc {
122         write(String.valueOf(f));
123     }
124
125     public void print(double d) throws IOException JavaDoc {
126         write(String.valueOf(d));
127     }
128
129     public void print(char s[]) throws IOException JavaDoc {
130         write(s);
131     }
132
133     public void print(String JavaDoc s) throws IOException JavaDoc {
134         if (null == s) {
135             s = "null";
136         }
137         write(s);
138     }
139
140     public void print(Object JavaDoc obj) throws IOException JavaDoc {
141         write(String.valueOf(obj));
142     }
143
144     public void println() throws IOException JavaDoc {
145         newLine();
146     }
147
148     public void println(boolean x) throws IOException JavaDoc {
149         print(x);
150         println();
151     }
152
153     public void println(char x) throws IOException JavaDoc {
154         print(x);
155         println();
156     }
157
158     public void println(int x) throws IOException JavaDoc {
159         print(x);
160         println();
161     }
162
163     public void println(long x) throws IOException JavaDoc {
164         print(x);
165         println();
166     }
167
168     public void println(float x) throws IOException JavaDoc {
169         print(x);
170         println();
171     }
172
173     public void println(double x) throws IOException JavaDoc {
174         print(x);
175         println();
176     }
177
178     public void println(char x[]) throws IOException JavaDoc {
179         print(x);
180         println();
181     }
182
183     public void println(String JavaDoc x) throws IOException JavaDoc {
184         print(x);
185         println();
186     }
187
188     public void println(Object JavaDoc x) throws IOException JavaDoc {
189         print(x);
190         println();
191     }
192
193 }
194
Popular Tags