org.databene.platform.fixedwidth
Class FixedWidthEntityExporter

java.lang.Object
  extended by org.databene.benerator.consumer.AbstractConsumer
      extended by org.databene.benerator.consumer.FormattingConsumer
          extended by org.databene.benerator.consumer.TextFileExporter
              extended by org.databene.platform.fixedwidth.FixedWidthEntityExporter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, Consumer, FileExporter
Direct Known Subclasses:
FlatFileEntityExporter

public class FixedWidthEntityExporter
extends TextFileExporter

Exports Entities to fixed-width files.

Created: 26.08.2007 06:17:41

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.consumer.TextFileExporter
append, encoding, lineSeparator, printer, uri, wasAppended
 
Fields inherited from class org.databene.benerator.consumer.FormattingConsumer
plainConverter
 
Constructor Summary
FixedWidthEntityExporter()
           
FixedWidthEntityExporter(java.lang.String uri, java.lang.String columnFormatList)
           
FixedWidthEntityExporter(java.lang.String uri, java.lang.String encoding, java.lang.String columnFormatList)
           
 
Method Summary
 void close()
          When called, the implementor has to close and free all resources.
 void flush()
          Is called by Benerator for advising the Consumer to finish processing of the objects consumed so far.
protected  void postInitPrinter(java.lang.Object object)
          This method is called after printer initialization and before writing the first data entry.
 void setColumns(java.lang.String columnFormatList)
           
protected  void startConsumingImpl(java.lang.Object object)
          Writes the data to the output file.
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.consumer.TextFileExporter
getEncoding, getLineSeparator, getUri, initPrinter, isAppend, preClosePrinter, println, setAppend, setEncoding, setLineSeparator, setUri, startProductConsumption
 
Methods inherited from class org.databene.benerator.consumer.FormattingConsumer
format, getDateCapitalization, getDatePattern, getDateTimePattern, getDecimalPattern, getDecimalSeparator, getIntegralPattern, getNullString, getTimePattern, getTimestampCapitalization, getTimestampPattern, setDateCapitalization, setDatePattern, setDateTimePattern, setDecimalPattern, setDecimalSeparator, setIntegralPattern, setNullString, setTimePattern, setTimestampCapitalization, setTimestampPattern
 
Methods inherited from class org.databene.benerator.consumer.AbstractConsumer
finishConsuming, finishProductConsumption, startConsuming
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.Consumer
finishConsuming, startConsuming
 

Constructor Detail

FixedWidthEntityExporter

public FixedWidthEntityExporter()

FixedWidthEntityExporter

public FixedWidthEntityExporter(java.lang.String uri,
                                java.lang.String columnFormatList)

FixedWidthEntityExporter

public FixedWidthEntityExporter(java.lang.String uri,
                                java.lang.String encoding,
                                java.lang.String columnFormatList)
Method Detail

setColumns

public void setColumns(java.lang.String columnFormatList)

flush

public void flush()
Description copied from interface: Consumer
Is called by Benerator for advising the Consumer to finish processing of the objects consumed so far. In Benerator descriptor files, the flushing behavior is controlled by the pageSize attribute.

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in interface Consumer
Overrides:
flush in class TextFileExporter

close

public void close()
Description copied from interface: Consumer
When called, the implementor has to close and free all resources. It will not receive any more calls.

Specified by:
close in interface java.io.Closeable
Specified by:
close in interface Consumer
Overrides:
close in class TextFileExporter

postInitPrinter

protected void postInitPrinter(java.lang.Object object)
Description copied from class: TextFileExporter
This method is called after printer initialization and before writing the first data entry. Overwrite this method in child classes e.g. for writing a file header.

Overrides:
postInitPrinter in class TextFileExporter
Parameters:
object - the first data item to write to the file

startConsumingImpl

protected void startConsumingImpl(java.lang.Object object)
Description copied from class: TextFileExporter
Writes the data to the output file. It uses the parent class settings for rendering the object. Overwrite this in a child class for custom output formats.

Overrides:
startConsumingImpl in class TextFileExporter
Parameters:
object - the data object to output

toString

public java.lang.String toString()
Overrides:
toString in class TextFileExporter


Copyright © 2013. All Rights Reserved.