public class MultiResourceItemReaderBuilder<T>
extends java.lang.Object
MultiResourceItemReader
.MultiResourceItemReader
Constructor and Description |
---|
MultiResourceItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
MultiResourceItemReader<T> |
build()
Builds the
MultiResourceItemReader . |
MultiResourceItemReaderBuilder<T> |
comparator(java.util.Comparator<org.springframework.core.io.Resource> comparator)
Used to order the injected resources, by default compares
Resource.getFilename() values. |
MultiResourceItemReaderBuilder<T> |
delegate(ResourceAwareItemReaderItemStream<? extends T> delegate)
Establishes the delegate to use for reading the resources provided.
|
MultiResourceItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
MultiResourceItemReaderBuilder<T> |
resources(org.springframework.core.io.Resource... resources)
The array of resources that the
MultiResourceItemReader will use to
retrieve items. |
MultiResourceItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
MultiResourceItemReaderBuilder<T> |
setStrict(boolean strict)
In strict mode the reader will throw an exception on
MultiResourceItemReader.open(org.springframework.batch.item.ExecutionContext)
if there are no resources to read. |
public MultiResourceItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic MultiResourceItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public MultiResourceItemReaderBuilder<T> resources(org.springframework.core.io.Resource... resources)
MultiResourceItemReader
will use to
retrieve items.resources
- the array of resources to use.MultiResourceItemReader.setResources(Resource[])
public MultiResourceItemReaderBuilder<T> delegate(ResourceAwareItemReaderItemStream<? extends T> delegate)
delegate
- reads items from single Resource
.MultiResourceItemReader.setDelegate(ResourceAwareItemReaderItemStream)
public MultiResourceItemReaderBuilder<T> setStrict(boolean strict)
MultiResourceItemReader.open(org.springframework.batch.item.ExecutionContext)
if there are no resources to read.strict
- false by default.MultiResourceItemReader.setStrict(boolean)
public MultiResourceItemReaderBuilder<T> comparator(java.util.Comparator<org.springframework.core.io.Resource> comparator)
Resource.getFilename()
values.comparator
- the comparator to use for ordering resources.MultiResourceItemReader.setComparator(Comparator)
public MultiResourceItemReader<T> build()
MultiResourceItemReader
.MultiResourceItemReader