public class StaxEventItemReaderBuilder<T>
extends java.lang.Object
StaxEventItemReader
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
StaxEventItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
StaxEventItemReaderBuilder<T> |
addFragmentRootElements(java.util.List<java.lang.String> fragmentRootElements)
Adds the list of fragments to be used as the root of each chunk to the
configuration.
|
StaxEventItemReaderBuilder<T> |
addFragmentRootElements(java.lang.String... fragmentRootElements)
Adds the list of fragments to be used as the root of each chunk to the
configuration.
|
StaxEventItemReader<T> |
build()
Validates the configuration and builds a new
StaxEventItemReader |
StaxEventItemReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
StaxEventItemReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
StaxEventItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
StaxEventItemReaderBuilder<T> |
resource(org.springframework.core.io.Resource resource)
The
Resource to be used as input. |
StaxEventItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
StaxEventItemReaderBuilder<T> |
strict(boolean strict)
Setting this value to true indicates that it is an error if the input does not
exist and an exception will be thrown.
|
StaxEventItemReaderBuilder<T> |
unmarshaller(org.springframework.oxm.Unmarshaller unmarshaller)
An implementation of the
Unmarshaller from Spring's OXM module. |
StaxEventItemReaderBuilder<T> |
xmlInputFactory(javax.xml.stream.XMLInputFactory xmlInputFactory)
Set the
XMLInputFactory . |
public StaxEventItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic StaxEventItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public StaxEventItemReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public StaxEventItemReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public StaxEventItemReaderBuilder<T> resource(org.springframework.core.io.Resource resource)
Resource
to be used as input.resource
- the input to the reader.StaxEventItemReader.setResource(Resource)
public StaxEventItemReaderBuilder<T> unmarshaller(org.springframework.oxm.Unmarshaller unmarshaller)
Unmarshaller
from Spring's OXM module.unmarshaller
- component responsible for unmarshalling XML chunksStaxEventItemReader.setUnmarshaller(org.springframework.oxm.Unmarshaller)
public StaxEventItemReaderBuilder<T> addFragmentRootElements(java.lang.String... fragmentRootElements)
fragmentRootElements
- the XML root elements to be used to identify XML
chunks.StaxEventItemReader.setFragmentRootElementNames(String[])
public StaxEventItemReaderBuilder<T> addFragmentRootElements(java.util.List<java.lang.String> fragmentRootElements)
fragmentRootElements
- the XML root elements to be used to identify XML
chunks.StaxEventItemReader.setFragmentRootElementNames(String[])
public StaxEventItemReaderBuilder<T> strict(boolean strict)
strict
- indicates the input file must existStaxEventItemReader.setStrict(boolean)
public StaxEventItemReaderBuilder<T> xmlInputFactory(javax.xml.stream.XMLInputFactory xmlInputFactory)
XMLInputFactory
.xmlInputFactory
- to useStaxEventItemReader.setXmlInputFactory(XMLInputFactory)
public StaxEventItemReader<T> build()
StaxEventItemReader
StaxEventItemReader