Package org.eclipse.jetty.server
Class ResponseWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.PrintWriter
-
- org.eclipse.jetty.server.ResponseWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class ResponseWriter extends java.io.PrintWriter
Specialized PrintWriter for servlet ResponsesAn instance of ResponseWriter is the
PrintWriter
subclass returned byResponse.getWriter()
. It differs from the standardPrintWriter
in that:- It does not support autoflush
- The default Locale for
format(String, Object...)
is the locale obtained byServletResponse.getLocale()
- If a write or print method is called while
checkError()
returns true, then aRuntimeIOException
is thrown to stop needless iterations. - The writer may be reopen to allow for recycling
-
-
Constructor Summary
Constructors Constructor Description ResponseWriter(HttpWriter httpWriter, java.util.Locale locale, java.lang.String encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkError()
protected void
clearError()
void
close()
void
complete(Callback callback)
void
flush()
java.io.PrintWriter
format(java.lang.String format, java.lang.Object... args)
java.io.PrintWriter
format(java.util.Locale locale, java.lang.String format, java.lang.Object... args)
boolean
isFor(java.util.Locale locale, java.lang.String encoding)
void
print(boolean b)
void
print(char c)
void
print(char[] s)
void
print(double d)
void
print(float f)
void
print(int i)
void
print(long l)
void
print(java.lang.Object obj)
void
print(java.lang.String s)
java.io.PrintWriter
printf(java.lang.String format, java.lang.Object... args)
java.io.PrintWriter
printf(java.util.Locale l, java.lang.String format, java.lang.Object... args)
void
println()
void
println(boolean b)
void
println(char c)
void
println(char[] s)
void
println(double x)
void
println(float x)
void
println(int x)
void
println(long x)
void
println(java.lang.Object x)
void
println(java.lang.String s)
protected void
reopen()
protected void
setError()
void
write(char[] buf)
void
write(char[] buf, int off, int len)
void
write(int c)
void
write(java.lang.String s)
void
write(java.lang.String s, int off, int len)
-
-
-
Constructor Detail
-
ResponseWriter
public ResponseWriter(HttpWriter httpWriter, java.util.Locale locale, java.lang.String encoding)
-
-
Method Detail
-
isFor
public boolean isFor(java.util.Locale locale, java.lang.String encoding)
-
reopen
protected void reopen()
-
clearError
protected void clearError()
- Overrides:
clearError
in classjava.io.PrintWriter
-
checkError
public boolean checkError()
- Overrides:
checkError
in classjava.io.PrintWriter
-
setError
protected void setError()
- Overrides:
setError
in classjava.io.PrintWriter
-
flush
public void flush()
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.PrintWriter
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.PrintWriter
-
complete
public void complete(Callback callback)
-
write
public void write(int c)
- Overrides:
write
in classjava.io.PrintWriter
-
write
public void write(char[] buf, int off, int len)
- Overrides:
write
in classjava.io.PrintWriter
-
write
public void write(char[] buf)
- Overrides:
write
in classjava.io.PrintWriter
-
write
public void write(java.lang.String s, int off, int len)
- Overrides:
write
in classjava.io.PrintWriter
-
write
public void write(java.lang.String s)
- Overrides:
write
in classjava.io.PrintWriter
-
print
public void print(boolean b)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(char c)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(int i)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(long l)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(float f)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(double d)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(char[] s)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(java.lang.String s)
- Overrides:
print
in classjava.io.PrintWriter
-
print
public void print(java.lang.Object obj)
- Overrides:
print
in classjava.io.PrintWriter
-
println
public void println()
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(boolean b)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(char c)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(int x)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(long x)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(float x)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(double x)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(char[] s)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(java.lang.String s)
- Overrides:
println
in classjava.io.PrintWriter
-
println
public void println(java.lang.Object x)
- Overrides:
println
in classjava.io.PrintWriter
-
printf
public java.io.PrintWriter printf(java.lang.String format, java.lang.Object... args)
- Overrides:
printf
in classjava.io.PrintWriter
-
printf
public java.io.PrintWriter printf(java.util.Locale l, java.lang.String format, java.lang.Object... args)
- Overrides:
printf
in classjava.io.PrintWriter
-
format
public java.io.PrintWriter format(java.lang.String format, java.lang.Object... args)
- Overrides:
format
in classjava.io.PrintWriter
-
format
public java.io.PrintWriter format(java.util.Locale locale, java.lang.String format, java.lang.Object... args)
- Overrides:
format
in classjava.io.PrintWriter
-
-