com.xmlmind.util
Class ConsoleCapture

java.lang.Object
  extended by com.xmlmind.util.ConsoleCapture

public final class ConsoleCapture
extends java.lang.Object

Utility class allowing to redirect all the messages printed to System.out and System.err to a Console.


Field Summary
 Console console
          The Console to which all the messages are redirected.
 
Constructor Summary
ConsoleCapture(Console console)
          Constructs an utility object allowing to redirect all the messages printed to System.out and System.err to specified Console.
 
Method Summary
 void begin()
          Start message redirection.
 void end()
          Stop message redirection and restore the real System.out and System.err.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

console

public final Console console
The Console to which all the messages are redirected.

Constructor Detail

ConsoleCapture

public ConsoleCapture(Console console)
Constructs an utility object allowing to redirect all the messages printed to System.out and System.err to specified Console.

Method Detail

begin

public void begin()
Start message redirection.

See Also:
end()

end

public void end()
Stop message redirection and restore the real System.out and System.err.

See Also:
begin()