Package org.apache.jasper.compiler
Class AntCompiler.SystemLogHandler
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.PrintStream
-
- org.apache.jasper.compiler.AntCompiler.SystemLogHandler
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
- Enclosing class:
- AntCompiler
protected static class AntCompiler.SystemLogHandler extends PrintStream
-
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<ByteArrayOutputStream>dataThread <-> ByteArrayOutputStream associations.protected static ThreadLocal<PrintStream>streamsThread <-> PrintStream associations.protected PrintStreamwrappedWrapped PrintStream.-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description SystemLogHandler(PrintStream wrapped)Construct the handler to capture the output of the given steam.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckError()voidclose()protected PrintStreamfindStream()Find PrintStream to which the output must be written to.voidflush()voidprint(boolean b)voidprint(char c)voidprint(char[] s)voidprint(double d)voidprint(float f)voidprint(int i)voidprint(long l)voidprint(Object obj)voidprint(String s)voidprintln()voidprintln(boolean x)voidprintln(char x)voidprintln(char[] x)voidprintln(double x)voidprintln(float x)voidprintln(int x)voidprintln(long x)voidprintln(Object x)voidprintln(String x)protected voidsetError()static voidsetThread()Start capturing thread's output.static StringunsetThread()Stop capturing thread's output and return captured data as a String.voidwrite(byte[] b)voidwrite(byte[] buf, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.PrintStream
append, append, append, clearError, format, format, printf, printf
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
wrapped
protected final PrintStream wrapped
Wrapped PrintStream.
-
streams
protected static final ThreadLocal<PrintStream> streams
Thread <-> PrintStream associations.
-
data
protected static final ThreadLocal<ByteArrayOutputStream> data
Thread <-> ByteArrayOutputStream associations.
-
-
Constructor Detail
-
SystemLogHandler
public SystemLogHandler(PrintStream wrapped)
Construct the handler to capture the output of the given steam.- Parameters:
wrapped- The wrapped stream
-
-
Method Detail
-
setThread
public static void setThread()
Start capturing thread's output.
-
unsetThread
public static String unsetThread()
Stop capturing thread's output and return captured data as a String.- Returns:
- the captured output
-
findStream
protected PrintStream findStream()
Find PrintStream to which the output must be written to.- Returns:
- the current stream
-
flush
public void flush()
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classPrintStream
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classPrintStream
-
checkError
public boolean checkError()
- Overrides:
checkErrorin classPrintStream
-
setError
protected void setError()
- Overrides:
setErrorin classPrintStream
-
write
public void write(int b)
- Overrides:
writein classPrintStream
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len)- Overrides:
writein classPrintStream
-
print
public void print(boolean b)
- Overrides:
printin classPrintStream
-
print
public void print(char c)
- Overrides:
printin classPrintStream
-
print
public void print(int i)
- Overrides:
printin classPrintStream
-
print
public void print(long l)
- Overrides:
printin classPrintStream
-
print
public void print(float f)
- Overrides:
printin classPrintStream
-
print
public void print(double d)
- Overrides:
printin classPrintStream
-
print
public void print(char[] s)
- Overrides:
printin classPrintStream
-
print
public void print(String s)
- Overrides:
printin classPrintStream
-
print
public void print(Object obj)
- Overrides:
printin classPrintStream
-
println
public void println()
- Overrides:
printlnin classPrintStream
-
println
public void println(boolean x)
- Overrides:
printlnin classPrintStream
-
println
public void println(char x)
- Overrides:
printlnin classPrintStream
-
println
public void println(int x)
- Overrides:
printlnin classPrintStream
-
println
public void println(long x)
- Overrides:
printlnin classPrintStream
-
println
public void println(float x)
- Overrides:
printlnin classPrintStream
-
println
public void println(double x)
- Overrides:
printlnin classPrintStream
-
println
public void println(char[] x)
- Overrides:
printlnin classPrintStream
-
println
public void println(String x)
- Overrides:
printlnin classPrintStream
-
println
public void println(Object x)
- Overrides:
printlnin classPrintStream
-
-