Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T > Class Template Reference

A restartable T:Summer.Batch.Item.ItemWriterthat writes to a T:Summer.Batch.IO.IResource. A T:LineAggregator is used to write lines from items. More...

Inheritance diagram for Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >:
Summer.Batch.Infrastructure.Item.Support.AbstractItemStreamItemWriter< T > Summer.Batch.Infrastructure.Item.File.IResourceAwareItemWriterItemStream< T > Summer.Batch.Common.Factory.IInitializationPostOperations Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport Summer.Batch.Infrastructure.Item.IItemStreamWriter< T > Summer.Batch.Infrastructure.Item.IItemStreamWriter< T > Summer.Batch.Infrastructure.Item.IItemStream Summer.Batch.Infrastructure.Item.IItemStream Summer.Batch.Infrastructure.Item.IItemWriter< T > Summer.Batch.Infrastructure.Item.IItemStream Summer.Batch.Infrastructure.Item.IItemWriter< T >

Public Member Functions

 FlatFileItemWriter ()
 Default constructor More...
 
void AfterPropertiesSet ()
 
override void Write (IList< T > items)
 Writes items to the target resource. More...
 
override void Open (ExecutionContext executionContext)
 Open the stream for the provided ExecutionContext. More...
 
override void Close ()
 If any resources are needed for the stream to operate they need to be destroyed here. Once this method has been called all other methods (except open) may throw an exception. More...
 
override void Update (ExecutionContext executionContext)
 Indicates that the execution context provided during open is about to be saved. If any state is remaining, but has not been put in the context, it should be added here. More...
 
override void Flush ()
 Flushes the underlying stream. More...
 
- Public Member Functions inherited from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport
string GetExecutionContextKey (string key)
 Transform the given key to use the name of this instance as prefix. More...
 
virtual void Dispose ()
 

Protected Member Functions

override void Dispose (bool disposing)
 Implements IDisposable. More...
 

Properties

IResource Resource [set]
 The T:Summer.Batch.IO.IResource to write to. More...
 
ILineAggregator< T > LineAggregator [set]
 The T:LineAggregator that transforms an item into a line. More...
 
IHeaderWriter HeaderWriter [set]
 The T:HeaderWriter to use. Can be null if there are no header to write. More...
 
IFooterWriter FooterWriter [set]
 The T:FooterWriter to use. Can be null if there are no footer to write. More...
 
string LineSeparator [set]
 The line separator to use. Default is P:System.Environment.NewLine. More...
 
bool AppendAllowed [set]
 Indicates that the target resource should be appended if it already exists. Default is false. More...
 
bool DeleteIfExists [set]
 Indicates that the target resource should be deleted if it exists. Ignored if P:AppendAllowed is true. Default is false. More...
 
bool DeleteIfEmpty [set]
 Indicates that the target resource should be deleted if no lines were written. Default is false. More...
 
Encoding Encoding [set]
 The encoding to use to write to the resource. Default is P:System.Text.Encoding.Default. More...
 
bool Transactional [set]
 Indicates that the writer should take part in the active transaction. During a transaction, data are written at commit. Defaults is true. More...
 
bool AutoFlush [set]
 Indicates that the buffer should be flushed after each write Default is false. More...
 
bool SaveState [set]
 Indicates that the state of the item writer should be savec in the execution context when M:Update is called. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport
string Name [set]
 The name of the component that will be used as prefix for keys in the execution context. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Item.File.IResourceAwareItemWriterItemStream< T >
IResource Resource [set]
 The T:Summer.Batch.Common.IO.IResource to write to. More...
 

Detailed Description

A restartable T:Summer.Batch.Item.ItemWriterthat writes to a T:Summer.Batch.IO.IResource. A T:LineAggregator is used to write lines from items.

Template Parameters
T 
Type Constraints
T :class 

Constructor & Destructor Documentation

Member Function Documentation

See also
IInitializationPostOperations::AfterPropertiesSet

Implements Summer.Batch.Common.Factory.IInitializationPostOperations.

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >.Close ( )
virtual

If any resources are needed for the stream to operate they need to be destroyed here. Once this method has been called all other methods (except open) may throw an exception.

Exceptions
ItemStreamException 

Reimplemented from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport.

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >.Dispose ( bool  disposing)
protectedvirtual

Implements IDisposable.

Parameters
disposing

Reimplemented from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport.

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >.Flush ( )
virtual

Flushes the underlying stream.

Reimplemented from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport.

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >.Open ( ExecutionContext  executionContext)
virtual

Open the stream for the provided ExecutionContext.

Parameters
executionContextcurrent step's ExecutionContext. Will be the executionContext from the last run of the step on a restart.
Exceptions
ItemStreamException 
ArgumentException if execution context is null

Reimplemented from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport.

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >.Update ( ExecutionContext  executionContext)
virtual

Indicates that the execution context provided during open is about to be saved. If any state is remaining, but has not been put in the context, it should be added here.

Parameters
executionContextto be updated
Exceptions
ItemStreamException 
ArgumentException if execution context is null

Reimplemented from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport.

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemWriter< T >.Write ( IList< T >  items)
virtual

Writes items to the target resource.

Parameters
itemsan enumerable containing the items to write
Exceptions
Summer.Batch.Infrastructure.Item.ItemWriterException

Implements Summer.Batch.Infrastructure.Item.Support.AbstractItemStreamItemWriter< T >.

Property Documentation

Indicates that the target resource should be appended if it already exists. Default is false.

Indicates that the buffer should be flushed after each write Default is false.

Indicates that the target resource should be deleted if no lines were written. Default is false.

Indicates that the target resource should be deleted if it exists. Ignored if P:AppendAllowed is true. Default is false.

The encoding to use to write to the resource. Default is P:System.Text.Encoding.Default.

The T:FooterWriter to use. Can be null if there are no footer to write.

The T:HeaderWriter to use. Can be null if there are no header to write.

The T:LineAggregator that transforms an item into a line.

The line separator to use. Default is P:System.Environment.NewLine.

The T:Summer.Batch.IO.IResource to write to.

Indicates that the state of the item writer should be savec in the execution context when M:Update is called.

Indicates that the writer should take part in the active transaction. During a transaction, data are written at commit. Defaults is true.


The documentation for this class was generated from the following file:
  • Summer.Batch.Infrastructure/Item/File/FlatFileItemWriter.cs