groovy.ui
Class SystemOutputInterceptor

Intercepts System.out. Implementation helper for Console.groovy.

version:
$Id: SystemOutputInterceptor.java 7797 2007-08-28 15:36:50Z shemnon $

Field Summary
 Closure callback
           
 
Constructor Summary
SystemOutputInterceptor(Closure callback)
            Constructor accepts a string to be sent to std out and returns a Boolean.
 
Method Summary
void start()
           Starts intercepting System.out
void stop()
           Stops intercepting System.out, sending output to whereever it was going when this interceptor was created.
void write(def b, int off, int len)
           Intercepts output - moret common case of byte[]
void write(int b)
           Intercepts output - single characters
 

Constructor Detail

SystemOutputInterceptor

public SystemOutputInterceptor(Closure callback)
Constructor
param:
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.


Method Detail

start

public void start()
Starts intercepting System.out


stop

public void stop()
Stops intercepting System.out, sending output to whereever it was going when this interceptor was created.


write

public void write(def b, int off, int len)
Intercepts output - moret common case of byte[]


write

public void write(int b)
Intercepts output - single characters