public class MappingLdifReaderBuilder<T>
extends java.lang.Object
Constructor and Description |
---|
MappingLdifReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
MappingLdifReader<T> |
build()
Returns a fully constructed
MappingLdifReader . |
MappingLdifReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
MappingLdifReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
MappingLdifReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
MappingLdifReaderBuilder<T> |
recordMapper(RecordMapper<T> recordMapper)
Setter for object mapper.
|
MappingLdifReaderBuilder<T> |
recordsToSkip(int recordsToSkip)
Public setter for the number of lines to skip at the start of a file.
|
MappingLdifReaderBuilder<T> |
resource(org.springframework.core.io.Resource resource)
Establishes the resource that will be used as the input for the MappingLdifReader.
|
MappingLdifReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
MappingLdifReaderBuilder<T> |
skippedRecordsCallback(RecordCallbackHandler skippedRecordsCallback)
RecordCallbackHandler implementations can be used to
take action on skipped records. |
MappingLdifReaderBuilder<T> |
strict(boolean strict)
In strict mode the reader will throw an exception on
AbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext) if
the input resource does not exist. |
public MappingLdifReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic MappingLdifReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public MappingLdifReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public MappingLdifReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public MappingLdifReaderBuilder<T> strict(boolean strict)
AbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext)
if
the input resource does not exist.strict
- true by defaultMappingLdifReader.setStrict(boolean)
public MappingLdifReaderBuilder<T> skippedRecordsCallback(RecordCallbackHandler skippedRecordsCallback)
RecordCallbackHandler
implementations can be used to
take action on skipped records.skippedRecordsCallback
- will be called for each one of the initial skipped
lines before any items are read.MappingLdifReader.setSkippedRecordsCallback(RecordCallbackHandler)
public MappingLdifReaderBuilder<T> recordsToSkip(int recordsToSkip)
recordsToSkip
- the number of lines to skipMappingLdifReader.setRecordsToSkip(int)
public MappingLdifReaderBuilder<T> resource(org.springframework.core.io.Resource resource)
resource
- the resource that will be read.MappingLdifReader.setResource(Resource)
public MappingLdifReaderBuilder<T> recordMapper(RecordMapper<T> recordMapper)
recordMapper
- maps record to an objectpublic MappingLdifReader<T> build()
MappingLdifReader
.MappingLdifReader