类 MappingLdifReaderBuilder<T>
- java.lang.Object
- org.springframework.batch.item.ldif.builder.MappingLdifReaderBuilder<T>
public class MappingLdifReaderBuilder<T> extends java.lang.Object
Creates a fully qualified MappingLdifReader.- 从以下版本开始:
- 4.0
- 作者:
- Glenn Renfro
构造器概要
构造器 构造器 说明 MappingLdifReaderBuilder()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 MappingLdifReader<T>
build()
Returns a fully constructedMappingLdifReader
.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 theExecutionContext
.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 theItemStreamSupport
should be persisted within theExecutionContext
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 onAbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext)
if the input resource does not exist.
构造器详细资料
MappingLdifReaderBuilder
public MappingLdifReaderBuilder()
方法详细资料
saveState
public MappingLdifReaderBuilder<T> saveState(boolean saveState)
Configure if the state of theItemStreamSupport
should be persisted within theExecutionContext
for restart purposes.- 参数:
saveState
- defaults to true- 返回:
- The current instance of the builder.
name
public MappingLdifReaderBuilder<T> name(java.lang.String name)
The name used to calculate the key within theExecutionContext
. Required ifsaveState(boolean)
is set to true.- 参数:
name
- name of the reader instance- 返回:
- The current instance of the builder.
- 另请参阅:
ItemStreamSupport.setName(String)
maxItemCount
public MappingLdifReaderBuilder<T> maxItemCount(int maxItemCount)
Configure the max number of items to be read.- 参数:
maxItemCount
- the max items to be read- 返回:
- The current instance of the builder.
- 另请参阅:
AbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
currentItemCount
public MappingLdifReaderBuilder<T> currentItemCount(int currentItemCount)
Index for the current item. Used on restarts to indicate where to start from.- 参数:
currentItemCount
- current index- 返回:
- this instance for method chaining
- 另请参阅:
AbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
strict
public MappingLdifReaderBuilder<T> strict(boolean strict)
In strict mode the reader will throw an exception onAbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext)
if the input resource does not exist.- 参数:
strict
- true by default- 返回:
- this instance for method chaining.
- 另请参阅:
MappingLdifReader.setStrict(boolean)
skippedRecordsCallback
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.- 返回:
- this instance for method chaining.
- 另请参阅:
MappingLdifReader.setSkippedRecordsCallback(RecordCallbackHandler)
recordsToSkip
public MappingLdifReaderBuilder<T> recordsToSkip(int recordsToSkip)
Public setter for the number of lines to skip at the start of a file. Can be used if the file contains a header without useful (column name) information, and without a comment delimiter at the beginning of the lines.- 参数:
recordsToSkip
- the number of lines to skip- 返回:
- this instance for method chaining.
- 另请参阅:
MappingLdifReader.setRecordsToSkip(int)
resource
public MappingLdifReaderBuilder<T> resource(org.springframework.core.io.Resource resource)
Establishes the resource that will be used as the input for the MappingLdifReader.- 参数:
resource
- the resource that will be read.- 返回:
- this instance for method chaining.
- 另请参阅:
MappingLdifReader.setResource(Resource)
recordMapper
public MappingLdifReaderBuilder<T> recordMapper(RecordMapper<T> recordMapper)
Setter for object mapper. This property is required to be set.- 参数:
recordMapper
- maps record to an object- 返回:
- this instance for method chaining.
build
public MappingLdifReader<T> build()
Returns a fully constructedMappingLdifReader
.- 返回:
- a new
MappingLdifReader