|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer java.io.PrintWriter org.codehaus.groovy.grails.web.pages.GSPResponseWriter
public class GSPResponseWriter
NOTE: Based on work done by on the GSP standalone project (https://gsp.dev.java.net/) A buffered writer that won't commit the response until the buffer has reached the high water mark, or until flush() or close() is called.
Field Summary |
---|
Fields inherited from class java.io.PrintWriter |
---|
out |
Fields inherited from class java.io.Writer |
---|
lock |
Method Summary | |
---|---|
boolean |
checkError()
Flush the stream if it's not closed and check its error state. |
void |
close()
Close the stream. |
void |
flush()
Flush the stream. |
static GSPResponseWriter |
getInstance(ServletResponse response,
int max)
Static factory method to create the writer. |
static GSPResponseWriter |
getInstance(Writer target,
int max)
Static factory method to create the writer. |
GSPResponseWriter |
leftShift(Object value)
Provides Groovy << left shift operator, but intercepts call to make sure nulls are converted to "" strings |
void |
print(Object obj)
Print an object. |
void |
print(String s)
Print a string. |
void |
write(char[] buf,
int off,
int len)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(String s)
Writes a string. |
void |
write(String s,
int off,
int len)
Write a portion of a string. |
Methods inherited from class java.io.PrintWriter |
---|
append, append, append, append, append, append, append, append, append, clearError, format, format, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean checkError()
checkError
in class PrintWriter
public void close()
close
in interface Closeable
close
in class PrintWriter
checkError()
public void flush()
flush
in interface Flushable
flush
in class PrintWriter
checkError()
public static GSPResponseWriter getInstance(ServletResponse response, int max)
response
- max
-
public static GSPResponseWriter getInstance(Writer target, int max)
target
- The target writer to write toomax
-
public void print(Object obj)
String.valueOf(Object)
method is translated into bytes
according to the platform's default character encoding, and these bytes
are written in exactly the manner of the write(int)
method.
print
in class PrintWriter
obj
- The Object
to be printedObject.toString()
public void print(String s)
null
then the string
""
is printed. Otherwise, the string's characters are
converted into bytes according to the platform's default character
encoding, and these bytes are written in exactly the manner of the
write(int)
method.
print
in class PrintWriter
s
- The String
to be printedpublic void write(String s)
null
then the string
""
is printed.
write
in class PrintWriter
s
- The String
to be printedpublic void write(int c)
write
in class PrintWriter
c
- int specifying a character to be written.public void write(char[] buf, int off, int len)
write
in class PrintWriter
buf
- Array of charactersoff
- Offset from which to start writing characterslen
- Number of characters to writepublic void write(String s, int off, int len)
write
in class PrintWriter
s
- A Stringoff
- Offset from which to start writing characterslen
- Number of characters to writepublic GSPResponseWriter leftShift(Object value) throws IOException
value
- The value
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |