com.northconcepts.datapipeline.core
Class StreamWriter

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataWriter
          extended by com.northconcepts.datapipeline.core.StreamWriter

public class StreamWriter
extends DataWriter

Writes records to a stream in a human-readable format.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint
DataEndpoint.State
 
Field Summary
 
Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
BUFFER_SIZE, log
 
Constructor Summary
StreamWriter(File file)
           
StreamWriter(OutputStream outputStream)
           
StreamWriter(Writer writer)
           
 
Method Summary
 void close()
          Indicates that this endpoint has finished reading or writing.
 boolean getCloseStream()
           
 void open()
          Makes this endpoint ready for reading or writing.
 StreamWriter setCloseStream(boolean closeStream)
          Specifies if the stream should be closed when this writer is closed (default is false).
protected  void writeImpl(Record record)
          Overridden by subclasses to write the specified record to this DataWriter.
 
Methods inherited from class com.northconcepts.datapipeline.core.DataWriter
addExceptionProperties, getNestedWriter, getRootWriter, write
 
Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getDescription, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, setDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamWriter

public StreamWriter(File file)
             throws DataException
Throws:
DataException

StreamWriter

public StreamWriter(Writer writer)

StreamWriter

public StreamWriter(OutputStream outputStream)
Method Detail

getCloseStream

public boolean getCloseStream()

setCloseStream

public StreamWriter setCloseStream(boolean closeStream)
Specifies if the stream should be closed when this writer is closed (default is false).

Parameters:
closeStream -
Returns:
this writer

open

public void open()
          throws DataException
Description copied from class: DataEndpoint
Makes this endpoint ready for reading or writing.

Overrides:
open in class DataEndpoint
Throws:
DataException

close

public void close()
           throws DataException
Description copied from class: DataEndpoint
Indicates that this endpoint has finished reading or writing.

Overrides:
close in class DataEndpoint
Throws:
DataException

writeImpl

protected void writeImpl(Record record)
                  throws Throwable
Description copied from class: DataWriter
Overridden by subclasses to write the specified record to this DataWriter.

Specified by:
writeImpl in class DataWriter
Throws:
Throwable


Copyright (c) 2007-2012 North Concepts Inc. All Rights Reserved.