KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > WebWorkMockBodyContent


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.jsp;
6
7 import javax.servlet.jsp.JspWriter JavaDoc;
8 import javax.servlet.jsp.tagext.BodyContent JavaDoc;
9 import java.io.IOException JavaDoc;
10 import java.io.Reader JavaDoc;
11 import java.io.Writer JavaDoc;
12
13
14 /**
15  * WebWorkMockBodyContent
16  *
17  * @author Jason Carreira
18  * Date: Mar 15, 2004 10:50:56 PM
19  */

20 public class WebWorkMockBodyContent extends BodyContent JavaDoc {
21     //~ Instance fields ////////////////////////////////////////////////////////
22

23     private JspWriter JavaDoc jspWriter;
24     private String JavaDoc body = null;
25
26     //~ Constructors ///////////////////////////////////////////////////////////
27

28     public WebWorkMockBodyContent(JspWriter JavaDoc jspWriter) {
29         super(jspWriter);
30         this.jspWriter = jspWriter;
31     }
32
33     //~ Methods ////////////////////////////////////////////////////////////////
34

35     public Reader JavaDoc getReader() {
36         return null;
37     }
38
39     public int getRemaining() {
40         return jspWriter.getRemaining();
41     }
42
43     public void setString(String JavaDoc body) {
44         this.body = body;
45     }
46
47     public String JavaDoc getString() {
48         return body;
49     }
50
51     public void clear() throws IOException JavaDoc {
52         jspWriter.clear();
53     }
54
55     public void clearBuffer() throws IOException JavaDoc {
56         jspWriter.clearBuffer();
57     }
58
59     public void close() throws IOException JavaDoc {
60         jspWriter.close();
61     }
62
63     public void newLine() throws IOException JavaDoc {
64         jspWriter.newLine();
65     }
66
67     public void print(double v) throws IOException JavaDoc {
68         jspWriter.print(v);
69     }
70
71     public void print(int i) throws IOException JavaDoc {
72         jspWriter.print(i);
73     }
74
75     public void print(long l) throws IOException JavaDoc {
76         jspWriter.print(l);
77     }
78
79     public void print(float v) throws IOException JavaDoc {
80         jspWriter.print(v);
81     }
82
83     public void print(boolean b) throws IOException JavaDoc {
84         jspWriter.print(b);
85     }
86
87     public void print(String JavaDoc s) throws IOException JavaDoc {
88         jspWriter.print(s);
89     }
90
91     public void print(char c) throws IOException JavaDoc {
92         jspWriter.print(c);
93     }
94
95     public void print(Object JavaDoc o) throws IOException JavaDoc {
96         jspWriter.print(o);
97     }
98
99     public void print(char[] chars) throws IOException JavaDoc {
100         jspWriter.print(chars);
101     }
102
103     public void println() throws IOException JavaDoc {
104         jspWriter.println();
105     }
106
107     public void println(char c) throws IOException JavaDoc {
108         jspWriter.println(c);
109     }
110
111     public void println(String JavaDoc s) throws IOException JavaDoc {
112         jspWriter.println(s);
113     }
114
115     public void println(char[] chars) throws IOException JavaDoc {
116         jspWriter.println(chars);
117     }
118
119     public void println(boolean b) throws IOException JavaDoc {
120         jspWriter.println(b);
121     }
122
123     public void println(long l) throws IOException JavaDoc {
124         jspWriter.println(l);
125     }
126
127     public void println(int i) throws IOException JavaDoc {
128         jspWriter.println(i);
129     }
130
131     public void println(float v) throws IOException JavaDoc {
132         jspWriter.println(v);
133     }
134
135     public void println(double v) throws IOException JavaDoc {
136         jspWriter.println(v);
137     }
138
139     public void println(Object JavaDoc o) throws IOException JavaDoc {
140         jspWriter.println(o);
141     }
142
143     public void write(char[] chars, int i, int i1) throws IOException JavaDoc {
144         jspWriter.write(chars, i, i1);
145     }
146
147     public void writeOut(Writer JavaDoc writer) throws IOException JavaDoc {
148         writer.write(body);
149     }
150 }
151
Popular Tags