Class DefaultFieldSetFactory
java.lang.Object
org.springframework.batch.item.file.transform.DefaultFieldSetFactory
- All Implemented Interfaces:
FieldSetFactory
Default implementation of
FieldSetFactory
with no special knowledge of the
FieldSet
required. Returns a DefaultFieldSet
from both factory methods.- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DefaultFieldSetFactory
(DateFormat dateFormat, NumberFormat numberFormat) Convenience constructor -
Method Summary
Modifier and TypeMethodDescriptionCreate a FieldSet with anonymous tokens.Create a FieldSet with named tokens.void
setDateFormat
(DateFormat dateFormat) TheDateFormat
to use for parsing dates.void
setNumberFormat
(NumberFormat numberFormat) TheNumberFormat
to use for parsing numbers.
-
Constructor Details
-
DefaultFieldSetFactory
public DefaultFieldSetFactory()Default constructor. -
DefaultFieldSetFactory
Convenience constructor- Parameters:
dateFormat
- theDateFormat
to use for parsing datesnumberFormat
- theNumberFormat
to use for parsing numbers- Since:
- 5.2
-
-
Method Details
-
setNumberFormat
TheNumberFormat
to use for parsing numbers. If unset thenLocale.US
will be used.- Parameters:
numberFormat
- theNumberFormat
to use for number parsing
-
setDateFormat
TheDateFormat
to use for parsing dates. If unset the default pattern is ISO standardyyyy-MM-dd
.- Parameters:
dateFormat
- theDateFormat
to use for date parsing
-
create
Create a FieldSet with named tokens. The token values can then be retrieved either by name or by column number.- Specified by:
create
in interfaceFieldSetFactory
- Parameters:
values
- the token valuesnames
- the names of the tokens- Returns:
- an instance of
FieldSet
. - See Also:
-
create
Create a FieldSet with anonymous tokens. They can only be retrieved by column number.- Specified by:
create
in interfaceFieldSetFactory
- Parameters:
values
- the token values- Returns:
- an instance of
FieldSet
. - See Also:
-