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

A restartable T:Summer.Batch.Item.ItemReader that reads lines from a T:Summer.Batch.IO.Resource. A line is mapped using a T:Summer.Batch.Item.File.LineMapper. More...

Inheritance diagram for Summer.Batch.Infrastructure.Item.File.FlatFileItemReader< T >:
Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T > Summer.Batch.Infrastructure.Item.File.IResourceAwareItemReaderItemStream< T > Summer.Batch.Common.Factory.IInitializationPostOperations Summer.Batch.Infrastructure.Item.Support.AbstractItemStreamItemReader< T > Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport Summer.Batch.Infrastructure.Item.IItemStreamReader< T > Summer.Batch.Infrastructure.Item.IItemStream

Public Member Functions

 FlatFileItemReader ()
 Default constructor. More...
 
void AfterPropertiesSet ()
 
- Public Member Functions inherited from Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >
override T Read ()
 Reads a piece of input data and advance to the next one. Implementations must return null at the end of the input data set. In a transactional setting, caller might get the same item twice from successive calls (or otherwise), if the first call was in a transaction that rolled back. 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...
 
- Public Member Functions inherited from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport
virtual void Flush ()
 Flushes the stream. More...
 
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 T DoRead ()
 Reads the next item from input. More...
 
override void DoOpen ()
 Opens the stream. More...
 
override void DoClose ()
 Closes the stream. More...
 
override void JumpToItem (int itemIndex)
 Jump to item with given index. More...
 
override void Dispose (bool disposing)
 Implementing IDisposable. More...
 

Properties

bool Strict [set]
 Determines if the reader is in strict mode. In strict mode it will throw an exception if the resource cannot be read. Default is true. More...
 
int LinesToSkip [set]
 The number of lines to skip at the start of the resource. More...
 
ILineMapper< T > LineMapper [set]
 The T:Summer.Batch.Item.File.LineMapper responsible for mapping lines to entities. More...
 
Encoding Encoding [set]
 The encoding of the resource. Default is P:System.Text.Encoding.Default. More...
 
IResource Resource [set]
 The resource to read from. In strict mode it should exist and be readable. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >
int CurrentItemCount [protected get, set]
 The index of the item to start reading from. If the execution context contains a key [name].read.count (where [name] is the name of this component), the value from the execution context will be used instead. More...
 
int MaxItemCount [set]
 The maximum index of the items to be read. If the execution context contains a key [name].read.count.max (where [name] is the name of this component), the value from the execution context will be used instead. More...
 
bool SaveState [get, set]
 Flat that determines whether to save internal data in the execution context. Default value is true. Switch to false if you don't want to save any state from this stream or you don't want it to be restartable. 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.IResourceAwareItemReaderItemStream< T >
IResource Resource [set]
 The T:Summer.Batch.IO.IResource to read from. More...
 

Detailed Description

A restartable T:Summer.Batch.Item.ItemReader that reads lines from a T:Summer.Batch.IO.Resource. A line is mapped using a T:Summer.Batch.Item.File.LineMapper.

Template Parameters
T the type of the entities read from the resource
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.FlatFileItemReader< T >.Dispose ( bool  disposing)
protectedvirtual

Implementing IDisposable.

Parameters
disposing

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

override T Summer.Batch.Infrastructure.Item.File.FlatFileItemReader< T >.DoRead ( )
protectedvirtual

Reads the next item from input.

Returns
the read item or null if the end of the stream has been reached

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

override void Summer.Batch.Infrastructure.Item.File.FlatFileItemReader< T >.JumpToItem ( int  itemIndex)
protectedvirtual

Jump to item with given index.

Parameters
itemIndex

Reimplemented from Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >.

Property Documentation

The encoding of the resource. Default is P:System.Text.Encoding.Default.

The T:Summer.Batch.Item.File.LineMapper responsible for mapping lines to entities.

The number of lines to skip at the start of the resource.

The resource to read from. In strict mode it should exist and be readable.

Determines if the reader is in strict mode. In strict mode it will throw an exception if the resource cannot be read. Default is true.


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