001: /*
002: * Copyright (c) 2002-2003 by OpenSymphony
003: * All rights reserved.
004: */
005: package com.opensymphony.webwork.views.jsp;
006:
007: import javax.servlet.jsp.JspWriter;
008: import javax.servlet.jsp.tagext.BodyContent;
009: import java.io.IOException;
010: import java.io.Reader;
011: import java.io.Writer;
012:
013: /**
014: * WebWorkMockBodyContent
015: *
016: * @author Jason Carreira
017: * Date: Mar 15, 2004 10:50:56 PM
018: */
019: public class WebWorkMockBodyContent extends BodyContent {
020:
021: private JspWriter jspWriter;
022: private String body = null;
023:
024: public WebWorkMockBodyContent(JspWriter jspWriter) {
025: super (jspWriter);
026: this .jspWriter = jspWriter;
027: }
028:
029: public Reader getReader() {
030: return null;
031: }
032:
033: public int getRemaining() {
034: return jspWriter.getRemaining();
035: }
036:
037: public void setString(String body) {
038: this .body = body;
039: }
040:
041: public String getString() {
042: return body;
043: }
044:
045: public void clear() throws IOException {
046: jspWriter.clear();
047: }
048:
049: public void clearBuffer() throws IOException {
050: jspWriter.clearBuffer();
051: }
052:
053: public void close() throws IOException {
054: jspWriter.close();
055: }
056:
057: public void newLine() throws IOException {
058: jspWriter.newLine();
059: }
060:
061: public void print(double v) throws IOException {
062: jspWriter.print(v);
063: }
064:
065: public void print(int i) throws IOException {
066: jspWriter.print(i);
067: }
068:
069: public void print(long l) throws IOException {
070: jspWriter.print(l);
071: }
072:
073: public void print(float v) throws IOException {
074: jspWriter.print(v);
075: }
076:
077: public void print(boolean b) throws IOException {
078: jspWriter.print(b);
079: }
080:
081: public void print(String s) throws IOException {
082: jspWriter.print(s);
083: }
084:
085: public void print(char c) throws IOException {
086: jspWriter.print(c);
087: }
088:
089: public void print(Object o) throws IOException {
090: jspWriter.print(o);
091: }
092:
093: public void print(char[] chars) throws IOException {
094: jspWriter.print(chars);
095: }
096:
097: public void println() throws IOException {
098: jspWriter.println();
099: }
100:
101: public void println(char c) throws IOException {
102: jspWriter.println(c);
103: }
104:
105: public void println(String s) throws IOException {
106: jspWriter.println(s);
107: }
108:
109: public void println(char[] chars) throws IOException {
110: jspWriter.println(chars);
111: }
112:
113: public void println(boolean b) throws IOException {
114: jspWriter.println(b);
115: }
116:
117: public void println(long l) throws IOException {
118: jspWriter.println(l);
119: }
120:
121: public void println(int i) throws IOException {
122: jspWriter.println(i);
123: }
124:
125: public void println(float v) throws IOException {
126: jspWriter.println(v);
127: }
128:
129: public void println(double v) throws IOException {
130: jspWriter.println(v);
131: }
132:
133: public void println(Object o) throws IOException {
134: jspWriter.println(o);
135: }
136:
137: public void write(char[] chars, int i, int i1) throws IOException {
138: jspWriter.write(chars, i, i1);
139: }
140:
141: public void writeOut(Writer writer) throws IOException {
142: writer.write(body);
143: }
144: }
|