@ConfigurationProperties(prefix="spring.batch.job.flatfileitemreader") public class FlatFileItemReaderProperties extends Object
FlatFileItemReader
.Constructor and Description |
---|
FlatFileItemReaderProperties() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getComments()
List of
String values used to indicate what records are comments. |
int |
getCurrentItemCount()
Provides the index of the current item.
|
String |
getDelimiter()
The
String used to divide the record into fields. |
String |
getEncoding()
Returns the encoding for the input file.
|
List<Integer> |
getIncludedFields()
A
List of indices indicating what fields to include. |
int |
getLinesToSkip()
Number of lines to skip when reading the input file.
|
int |
getMaxItemCount()
The maximum number of items to be read.
|
String |
getName()
Returns the configured value of the name used to calculate
ExecutionContext
keys. |
String[] |
getNames()
Names of each column.
|
char |
getQuoteCharacter()
The char used to indicate that a field is quoted.
|
List<org.springframework.batch.item.file.transform.Range> |
getRanges()
The column ranges to be used to parsed a fixed width file.
|
org.springframework.core.io.Resource |
getResource()
The input file for the
FlatFileItemReader . |
boolean |
isDelimited()
Indicates if the input file is a delimited file or not.
|
boolean |
isFixedLength()
Indicates that a file contains records with fixed length columns.
|
boolean |
isParsingStrict()
Indicates if the number of tokens must match the number of configured fields.
|
boolean |
isSaveState()
Returns the configured value of if the state of the reader will be persisted.
|
boolean |
isStrict()
Returns true if a missing input file is considered an error.
|
void |
setComments(List<String> comments)
Takes a list of
String elements used to indicate what records are comments. |
void |
setCurrentItemCount(int currentItemCount)
Index for the current item.
|
void |
setDelimited(boolean delimited)
Indicates that a
DelimitedLineTokenizer should be used to parse each line. |
void |
setDelimiter(String delimiter)
Define the delimiter for the file.
|
void |
setEncoding(String encoding)
Configure the encoding used by the reader to read the input source.
|
void |
setFixedLength(boolean fixedLength)
Indicates that a
FixedLengthTokenizer should
be used to parse the records in the file. |
void |
setIncludedFields(List<Integer> includedFields)
A list of indices of the fields within a delimited file to be included.
|
void |
setLinesToSkip(int linesToSkip)
The number of lines to skip at the beginning of reading the file.
|
void |
setMaxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
void |
setName(String name)
The name used to calculate the key within the
ExecutionContext . |
void |
setNames(String[] names)
The names of the fields to be parsed from the file.
|
void |
setParsingStrict(boolean parsingStrict)
Indicates if the number of tokens must match the number of configured fields.
|
void |
setQuoteCharacter(char quoteCharacter)
Define the character used to quote fields.
|
void |
setRanges(List<org.springframework.batch.item.file.transform.Range> ranges)
Column ranges for each field.
|
void |
setResource(org.springframework.core.io.Resource resource)
The
Resource to be used as input. |
void |
setSaveState(boolean saveState)
Configure if the state of the
ItemStreamSupport should be persisted within
the ExecutionContext for restart purposes. |
void |
setStrict(boolean strict)
Configure if the reader should be in strict mode (require the input
Resource to exist). |
public boolean isSaveState()
public void setSaveState(boolean saveState)
ItemStreamSupport
should be persisted within
the ExecutionContext
for restart purposes.saveState
- defaults to truepublic String getName()
ExecutionContext
keys.public void setName(String name)
ExecutionContext
. Required if
setSaveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public int getMaxItemCount()
public void setMaxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public int getCurrentItemCount()
public void setCurrentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public List<String> getComments()
String
values used to indicate what records are comments.public void setComments(List<String> comments)
String
elements used to indicate what records are comments.comments
- strings used to indicate commented linespublic org.springframework.core.io.Resource getResource()
FlatFileItemReader
.public void setResource(org.springframework.core.io.Resource resource)
Resource
to be used as input.resource
- the input to the reader.FlatFileItemReader.setResource(Resource)
public boolean isStrict()
public void setStrict(boolean strict)
Resource
to exist).strict
- true if the input file is required to exist.FlatFileItemReader.setStrict(boolean)
public String getEncoding()
FlatFileItemReader#DEFAULT_CHARSET
.public void setEncoding(String encoding)
FlatFileItemReader.DEFAULT_CHARSET
.encoding
- to use to read the input source.FlatFileItemReader.setEncoding(String)
public int getLinesToSkip()
public void setLinesToSkip(int linesToSkip)
linesToSkip
- number of lines to be skipped.FlatFileItemReader.setLinesToSkip(int)
public boolean isDelimited()
public void setDelimited(boolean delimited)
DelimitedLineTokenizer
should be used to parse each line.delimited
- true if the file is a delimited filepublic String getDelimiter()
String
used to divide the record into fields.public void setDelimiter(String delimiter)
delimiter
- String used as a delimiter between fields.DelimitedLineTokenizer.setDelimiter(String)
public char getQuoteCharacter()
public void setQuoteCharacter(char quoteCharacter)
quoteCharacter
- char used to define quoted fieldsDelimitedLineTokenizer.setQuoteCharacter(char)
public List<Integer> getIncludedFields()
List
of indices indicating what fields to include.public void setIncludedFields(List<Integer> includedFields)
includedFields
- indices of the fieldsDelimitedLineTokenizer.setIncludedFields(int[])
public boolean isFixedLength()
public void setFixedLength(boolean fixedLength)
FixedLengthTokenizer
should
be used to parse the records in the file.fixedLength
- true if the records should be tokenized by column indexpublic List<org.springframework.batch.item.file.transform.Range> getRanges()
Range
instancespublic void setRanges(List<org.springframework.batch.item.file.transform.Range> ranges)
ranges
- list of ranges in start-end format (end is optional)public String[] getNames()
public void setNames(String[] names)
names
- names of fieldspublic boolean isParsingStrict()
public void setParsingStrict(boolean parsingStrict)
parsingStrict
- true if they must matchCopyright © 2025 VMware, Inc.. All rights reserved.