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