com.northconcepts.datapipeline.fixedwidth
Class FixedWidthWriter

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataWriter
          extended by com.northconcepts.datapipeline.core.AbstractWriter
              extended by com.northconcepts.datapipeline.core.TextWriter
                  extended by com.northconcepts.datapipeline.core.LinedTextWriter
                      extended by com.northconcepts.datapipeline.fixedwidth.FixedWidthWriter

public class FixedWidthWriter
extends LinedTextWriter

Writes records to a fixed width stream.


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.AbstractWriter
currentRecord
 
Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
BUFFER_SIZE, log
 
Constructor Summary
FixedWidthWriter(File file)
           
FixedWidthWriter(Writer writer)
           
 
Method Summary
 DataException addExceptionProperties(DataException exception)
          Adds this endpoint's current state to a DataException.
 FixedWidthWriter addFields(int... width)
           
protected  void assembleLine(Record record, StringBuffer lineBuffer)
           
 char getFillChar()
           
 boolean isTruncateFields()
           
 FixedWidthWriter setFillChar(char fillChar)
           
 FixedWidthWriter setTruncateFields(boolean truncateFields)
           
 
Methods inherited from class com.northconcepts.datapipeline.core.LinedTextWriter
getNewLine, setNewLine, writeRecord
 
Methods inherited from class com.northconcepts.datapipeline.core.TextWriter
close, getFile, getWriter
 
Methods inherited from class com.northconcepts.datapipeline.core.AbstractWriter
isFieldNamesInFirstRow, open, setFieldNamesInFirstRow, write, writeImpl
 
Methods inherited from class com.northconcepts.datapipeline.core.DataWriter
getNestedWriter, getRootWriter
 
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

FixedWidthWriter

public FixedWidthWriter(File file)

FixedWidthWriter

public FixedWidthWriter(Writer writer)
Method Detail

getFillChar

public char getFillChar()

setFillChar

public FixedWidthWriter setFillChar(char fillChar)

isTruncateFields

public boolean isTruncateFields()

setTruncateFields

public FixedWidthWriter setTruncateFields(boolean truncateFields)

addFields

public FixedWidthWriter addFields(int... width)

addExceptionProperties

public DataException addExceptionProperties(DataException exception)
Description copied from class: DataEndpoint
Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.

Overrides:
addExceptionProperties in class LinedTextWriter

assembleLine

protected void assembleLine(Record record,
                            StringBuffer lineBuffer)
                     throws Throwable
Specified by:
assembleLine in class LinedTextWriter
Throws:
Throwable


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