Package org.apache.maven.shared.invoker
Class PrintStreamHandler
- java.lang.Object
-
- org.apache.maven.shared.invoker.PrintStreamHandler
-
- All Implemented Interfaces:
InvocationOutputHandler,org.apache.maven.shared.utils.cli.StreamConsumer
- Direct Known Subclasses:
SystemOutHandler
public class PrintStreamHandler extends java.lang.Object implements InvocationOutputHandler
Offers an output handler that writes to a print stream likeSystem.out.- Since:
- 2.0.9
-
-
Field Summary
Fields Modifier and Type Field Description private booleanalwaysFlushA flag whether the print stream should be flushed after each line.private java.io.PrintStreamoutThe print stream to write to, nevernull.
-
Constructor Summary
Constructors Constructor Description PrintStreamHandler()Creates a new output handler that writes toSystem.out.PrintStreamHandler(java.io.PrintStream out, boolean alwaysFlush)Creates a new output handler that writes to the specified print stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeLine(java.lang.String line)
-
-
-
Constructor Detail
-
PrintStreamHandler
public PrintStreamHandler()
Creates a new output handler that writes toSystem.out.
-
PrintStreamHandler
public PrintStreamHandler(java.io.PrintStream out, boolean alwaysFlush)Creates a new output handler that writes to the specified print stream.- Parameters:
out- The print stream to write to, must not benull.alwaysFlush- A flag whether the print stream should be flushed after each line.
-
-