lp.wrap
Class LparseWrapper.ErrorStreamProcessor

java.lang.Object
  extended by lp.wrap.LparseWrapper.ErrorStreamProcessor
All Implemented Interfaces:
Runnable
Enclosing class:
LparseWrapper

private class LparseWrapper.ErrorStreamProcessor
extends Object
implements Runnable

A helper thread that reads and parses contents of an lparse standard error stream and stores the resulting LparseMessage objects in LparseWrapper.error and LparseWrapper.warnings.


Field Summary
private  InputStream stream
          The InputStream to read stream.
 
Constructor Summary
LparseWrapper.ErrorStreamProcessor()
          Constructs a new instance of ErrorStreamProcessor.
 
Method Summary
private  void parseMessages()
          Parses all errors and warnings issued by lparse from its error output stream.
 void run()
          Runs the thread—here the stream set by setErrorStream(InputStream) is read and parsed.
 void setErrorStream(InputStream input)
          Sets the error stream to read from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

private InputStream stream
The InputStream to read stream.

Constructor Detail

LparseWrapper.ErrorStreamProcessor

public LparseWrapper.ErrorStreamProcessor()
Constructs a new instance of ErrorStreamProcessor.

Method Detail

setErrorStream

public void setErrorStream(InputStream input)
Sets the error stream to read from.


run

public void run()
Runs the thread—here the stream set by setErrorStream(InputStream) is read and parsed. Resulting LparseMessage objects are stored in LparseWrapper.error and LparseWrapper.warnings.

Specified by:
run in interface Runnable
Throws:
IOException - (wrapped in an WrapperException) if an I/O error occurs while parsing the stream

parseMessages

private void parseMessages()
                    throws IOException
Parses all errors and warnings issued by lparse from its error output stream.

Throws:
IOException - if an I/O error occurs while parsing the stream