|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream groovy.ui.SystemOutputInterceptor
public class SystemOutputInterceptor extends java.io.FilterOutputStream
Intercepts System.out/System.err. Implementation helper for Console.groovy.
Constructor Summary | |
SystemOutputInterceptor(Closure callback)
Constructor |
|
SystemOutputInterceptor(Closure callback, boolean output)
Constructor |
Method Summary | |
---|---|
void
|
start()
Starts intercepting System.out/System.err |
void
|
stop()
Stops intercepting System.out/System.err, sending output to wherever it was going when this interceptor was created. |
void
|
write(byte[] b, int off, int len)
Intercepts output - moret common case of byte[] |
void
|
write(int b)
Intercepts output - single characters |
Methods inherited from class java.io.FilterOutputStream | |
---|---|
java.io.FilterOutputStream#write([B, int, int), java.io.FilterOutputStream#write([B), java.io.FilterOutputStream#write(int), java.io.FilterOutputStream#close(), java.io.FilterOutputStream#flush(), java.io.FilterOutputStream#wait(long, int), java.io.FilterOutputStream#wait(long), java.io.FilterOutputStream#wait(), java.io.FilterOutputStream#equals(java.lang.Object), java.io.FilterOutputStream#toString(), java.io.FilterOutputStream#hashCode(), java.io.FilterOutputStream#getClass(), java.io.FilterOutputStream#notify(), java.io.FilterOutputStream#notifyAll() |
Methods inherited from class java.io.OutputStream | |
---|---|
java.io.OutputStream#write([B, int, int), java.io.OutputStream#write([B), java.io.OutputStream#write(int), java.io.OutputStream#close(), java.io.OutputStream#flush(), java.io.OutputStream#wait(long, int), java.io.OutputStream#wait(long), java.io.OutputStream#wait(), java.io.OutputStream#equals(java.lang.Object), java.io.OutputStream#toString(), java.io.OutputStream#hashCode(), java.io.OutputStream#getClass(), java.io.OutputStream#notify(), java.io.OutputStream#notifyAll() |
Constructor Detail |
---|
public SystemOutputInterceptor(Closure callback)
callback
- accepts a string to be sent to std out and returns a Boolean.
If the return value is true, output will be sent to
System.out, otherwise it will not.
public SystemOutputInterceptor(Closure callback, boolean output)
callback
- accepts a string to be sent to std out and returns a Boolean.
If the return value is true, output will be sent to
System.out/System.err, otherwise it will not.output
- flag that tells whether System.out needs capturing ot System.err
Method Detail |
---|
public void start()
public void stop()
public void write(byte[] b, int off, int len)
public void write(int b)
Groovy Documentation