|
||||||||||
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.apache.struts.util.ServletContextWriter
public class ServletContextWriter
A PrintWriter implementation that uses the logging facilities of a
javax.servlet.ServletContext
to output its results. Output
will be buffered until a newline character is output, flush()
is called, or until one of the println()
methods is called.
Along the way, carriage return characters are skipped.
Field Summary | |
---|---|
protected StringBuffer |
buffer
The buffer into which we accumulate lines to be logged. |
protected ServletContext |
context
The servlet context with which we are associated. |
protected boolean |
error
The error state for this stream. |
Fields inherited from class java.io.PrintWriter |
---|
out |
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
ServletContextWriter(ServletContext context)
Construct a ServletContextWriter associated with the specified ServletContext instance. |
Method Summary | |
---|---|
boolean |
checkError()
Flush the stream and check for its error state. |
void |
close()
Close the stream. |
void |
flush()
Flush the stream. |
void |
print(boolean b)
Print a boolean value. |
void |
print(char c)
Print a character value. |
void |
print(char[] c)
Print a character array. |
void |
print(double d)
Print a double value. |
void |
print(float f)
Print a float value. |
void |
print(int i)
Print an integer value. |
void |
print(long l)
Print a long value. |
void |
print(Object o)
Print an object. |
void |
print(String s)
Print a String value. |
void |
println()
Terminate the current line and flush the buffer. |
void |
println(boolean b)
Print a boolean value and terminate the line. |
void |
println(char c)
Print a character value and terminate the line. |
void |
println(char[] c)
Print a character array and terminate the line. |
void |
println(double d)
Print a double value and terminate the line. |
void |
println(float f)
Print a float value and terminate the line. |
void |
println(int i)
Print an integer value and terminate the line. |
void |
println(long l)
Print a long value and terminate the line. |
void |
println(Object o)
Print an object and terminate the line. |
void |
println(String s)
Print a String value and terminate the line. |
void |
setError()
Set the error state for this stream. |
void |
write(char c)
Write a single character to this stream. |
void |
write(char[] buf)
Write an array of charaters to this stream. |
void |
write(char[] buf,
int off,
int len)
Write the specified subset of an array of characters to this stream. |
void |
write(int c)
Write a single character to this stream. |
void |
write(String s)
Write a String to this stream. |
void |
write(String s,
int off,
int len)
Write the specified portion of a String to this stream. |
Methods inherited from class java.io.PrintWriter |
---|
append, append, append, clearError, format, format, printf, printf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StringBuffer buffer
protected ServletContext context
protected boolean error
Constructor Detail |
---|
public ServletContextWriter(ServletContext context)
context
- The associated servlet contextMethod Detail |
---|
public boolean checkError()
true
is if setError()
is called.
checkError
in class PrintWriter
public void close()
close
in interface Closeable
close
in class PrintWriter
public void flush()
flush
in interface Flushable
flush
in class PrintWriter
public void print(boolean b)
print
in class PrintWriter
b
- The value to be printedpublic void print(char c)
print
in class PrintWriter
c
- The value to be printedpublic void print(char[] c)
print
in class PrintWriter
c
- The character array to be printedpublic void print(double d)
print
in class PrintWriter
d
- The value to be printedpublic void print(float f)
print
in class PrintWriter
f
- The value to be printedpublic void print(int i)
print
in class PrintWriter
i
- The value to be printedpublic void print(long l)
print
in class PrintWriter
l
- The value to be printedpublic void print(Object o)
print
in class PrintWriter
o
- The value to be printedpublic void print(String s)
print
in class PrintWriter
s
- The value to be printedpublic void println()
println
in class PrintWriter
public void println(boolean b)
println
in class PrintWriter
b
- The value to be printedpublic void println(char c)
println
in class PrintWriter
c
- The value to be printedpublic void println(char[] c)
println
in class PrintWriter
c
- The character array to be printedpublic void println(double d)
println
in class PrintWriter
d
- The value to be printedpublic void println(float f)
println
in class PrintWriter
f
- The value to be printedpublic void println(int i)
println
in class PrintWriter
i
- The value to be printedpublic void println(long l)
println
in class PrintWriter
l
- The value to be printedpublic void println(Object o)
println
in class PrintWriter
o
- The value to be printedpublic void println(String s)
println
in class PrintWriter
s
- The value to be printedpublic void setError()
setError
in class PrintWriter
public void write(char c)
c
- The character to be writtenpublic void write(int c)
write
in class PrintWriter
c
- The character to be writtenpublic void write(char[] buf)
write
in class PrintWriter
buf
- The character array to be writtenpublic void write(char[] buf, int off, int len)
write
in class PrintWriter
buf
- The character array from which to writeoff
- The zero-relative starting offset to writelen
- The number of characters to writepublic void write(String s)
write
in class PrintWriter
s
- The string to be writtenpublic void write(String s, int off, int len)
write
in class PrintWriter
s
- The String from which to writeoff
- The zero-relative starting offset to writelen
- The number of characters to write
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |