com.izforge.izpack.installer
Class CompileWorker.EclipseStdErrHandler

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.PrintStream
              extended by com.izforge.izpack.installer.CompileWorker.EclipseStdErrHandler
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable
Enclosing class:
CompileWorker

private static class CompileWorker.EclipseStdErrHandler
extends java.io.PrintStream

This PrintStream is used to track the Eclipse compiler error output.

It will pass on all println requests and report progress to the listener.


Field Summary
private  int errorCount
           
private  CompileWorker.StdErrParser parser
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
CompileWorker.EclipseStdErrHandler(java.io.OutputStream anOutputStream, CompileHandler aHandler)
          Default constructor.
 
Method Summary
 int getErrorCount()
          Get the error state.
 void println(java.lang.String x)
          Eclipse compiler hopefully only uses println(String).
 void write(byte[] buf, int off, int len)
          Unfortunately, the Eclipse compiler wraps System.out into a BufferedWriter.
 
Methods inherited from class java.io.PrintStream
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorCount

private int errorCount

parser

private CompileWorker.StdErrParser parser
Constructor Detail

CompileWorker.EclipseStdErrHandler

public CompileWorker.EclipseStdErrHandler(java.io.OutputStream anOutputStream,
                                          CompileHandler aHandler)
Default constructor.

Parameters:
anOutputStream - The stream to wrap.
aHandler - the handler to use.
Method Detail

println

public void println(java.lang.String x)
Eclipse compiler hopefully only uses println(String).

Overrides:
println in class java.io.PrintStream

write

public void write(byte[] buf,
                  int off,
                  int len)
Unfortunately, the Eclipse compiler wraps System.out into a BufferedWriter.

So we get whole buffers here and cannot do anything about it.

Overrides:
write in class java.io.PrintStream

getErrorCount

public int getErrorCount()
Get the error state.

Returns:
true if there was an error detected.