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