Class FormatterLineAggregator<T>
java.lang.Object
org.springframework.batch.infrastructure.item.file.transform.ExtractorLineAggregator<T>
org.springframework.batch.infrastructure.item.file.transform.FormatterLineAggregator<T>
- All Implemented Interfaces:
LineAggregator<T>
A
LineAggregator implementation which produces a String by aggregating the
provided item via the Formatter syntax.- Author:
- Dave Syer, Stefano Cordio
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFormatterLineAggregator(String format) Create a newFormatterLineAggregatorwith the provided format. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdoAggregate(Object[] fields) Aggregate provided fields into single String.voidSet the format string used to aggregate items.voidPublic setter for the locale.voidsetMaximumLength(int maximumLength) Public setter for the maximum length of the formatted string.voidsetMinimumLength(int minimumLength) Public setter for the minimum length of the formatted string.Methods inherited from class ExtractorLineAggregator
aggregate, setFieldExtractor
-
Constructor Details
-
FormatterLineAggregator
Create a newFormatterLineAggregatorwith the provided format.- Parameters:
format- the format to use to aggregate fields- Since:
- 6.0
-
-
Method Details
-
setMinimumLength
public void setMinimumLength(int minimumLength) Public setter for the minimum length of the formatted string. If this is not set the default is to allow any length.- Parameters:
minimumLength- the minimum length to set
-
setMaximumLength
public void setMaximumLength(int maximumLength) Public setter for the maximum length of the formatted string. If this is not set the default is to allow any length.- Parameters:
maximumLength- the maximum length to set
-
setFormat
-
setLocale
Public setter for the locale.- Parameters:
locale- the locale to set
-
doAggregate
Description copied from class:ExtractorLineAggregatorAggregate provided fields into single String.- Specified by:
doAggregatein classExtractorLineAggregator<T>- Parameters:
fields- An array of the fields that must be aggregated- Returns:
- aggregated string
-