1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts2.views.jsp;
23
24 import java.io.IOException;
25 import java.io.Reader;
26 import java.io.Writer;
27
28 import javax.servlet.jsp.JspWriter;
29 import javax.servlet.jsp.tagext.BodyContent;
30
31
32 /***
33 * StrutsMockBodyContent
34 *
35 */
36 public class StrutsMockBodyContent extends BodyContent {
37
38 private JspWriter jspWriter;
39 private String body = null;
40
41
42 public StrutsMockBodyContent(JspWriter jspWriter) {
43 super(jspWriter);
44 this.jspWriter = jspWriter;
45 }
46
47
48 public Reader getReader() {
49 return null;
50 }
51
52 public int getRemaining() {
53 return jspWriter.getRemaining();
54 }
55
56 public void setString(String body) {
57 this.body = body;
58 }
59
60 public String getString() {
61 return body;
62 }
63
64 public void clear() throws IOException {
65 jspWriter.clear();
66 }
67
68 public void clearBuffer() throws IOException {
69 jspWriter.clearBuffer();
70 }
71
72 public void close() throws IOException {
73 jspWriter.close();
74 }
75
76 public void newLine() throws IOException {
77 jspWriter.newLine();
78 }
79
80 public void print(double v) throws IOException {
81 jspWriter.print(v);
82 }
83
84 public void print(int i) throws IOException {
85 jspWriter.print(i);
86 }
87
88 public void print(long l) throws IOException {
89 jspWriter.print(l);
90 }
91
92 public void print(float v) throws IOException {
93 jspWriter.print(v);
94 }
95
96 public void print(boolean b) throws IOException {
97 jspWriter.print(b);
98 }
99
100 public void print(String s) throws IOException {
101 jspWriter.print(s);
102 }
103
104 public void print(char c) throws IOException {
105 jspWriter.print(c);
106 }
107
108 public void print(Object o) throws IOException {
109 jspWriter.print(o);
110 }
111
112 public void print(char[] chars) throws IOException {
113 jspWriter.print(chars);
114 }
115
116 public void println() throws IOException {
117 jspWriter.println();
118 }
119
120 public void println(char c) throws IOException {
121 jspWriter.println(c);
122 }
123
124 public void println(String s) throws IOException {
125 jspWriter.println(s);
126 }
127
128 public void println(char[] chars) throws IOException {
129 jspWriter.println(chars);
130 }
131
132 public void println(boolean b) throws IOException {
133 jspWriter.println(b);
134 }
135
136 public void println(long l) throws IOException {
137 jspWriter.println(l);
138 }
139
140 public void println(int i) throws IOException {
141 jspWriter.println(i);
142 }
143
144 public void println(float v) throws IOException {
145 jspWriter.println(v);
146 }
147
148 public void println(double v) throws IOException {
149 jspWriter.println(v);
150 }
151
152 public void println(Object o) throws IOException {
153 jspWriter.println(o);
154 }
155
156 public void write(char[] chars, int i, int i1) throws IOException {
157 jspWriter.write(chars, i, i1);
158 }
159
160 public void writeOut(Writer writer) throws IOException {
161 writer.write(body);
162 }
163 }