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