|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.item.file.transform.AbstractLineTokenizer org.springframework.batch.item.file.transform.DelimitedLineTokenizer
public class DelimitedLineTokenizer
A LineTokenizer
implementation that splits the input String on a
configurable delimiter. This implementation also supports the use of an
escape character to escape delimiters and line endings.
Field Summary | |
---|---|
static char |
DEFAULT_QUOTE_CHARACTER
Convenient constant for the common case of a " character used to escape delimiters or line endings. |
static char |
DELIMITER_COMMA
Convenient constant for the common case of a comma delimiter. |
static char |
DELIMITER_TAB
Convenient constant for the common case of a tab delimiter. |
Fields inherited from class org.springframework.batch.item.file.transform.AbstractLineTokenizer |
---|
names |
Constructor Summary | |
---|---|
DelimitedLineTokenizer()
Create a new instance of the DelimitedLineTokenizer class for the
common case where the delimiter is a comma . |
|
DelimitedLineTokenizer(char delimiter)
Create a new instance of the DelimitedLineTokenizer class. |
Method Summary | |
---|---|
protected List<String> |
doTokenize(String line)
Yields the tokens resulting from the splitting of the supplied line . |
protected boolean |
isQuoteCharacter(char c)
Is the supplied character a quote character? |
void |
setDelimiter(char delimiter)
Setter for the delimiter character. |
void |
setIncludedFields(int[] includedFields)
The fields to include in the output by position (starting at 0). |
void |
setQuoteCharacter(char quoteCharacter)
Public setter for the quoteCharacter. |
Methods inherited from class org.springframework.batch.item.file.transform.AbstractLineTokenizer |
---|
hasNames, isStrict, setFieldSetFactory, setNames, setStrict, tokenize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char DELIMITER_TAB
public static final char DELIMITER_COMMA
public static final char DEFAULT_QUOTE_CHARACTER
Constructor Detail |
---|
public DelimitedLineTokenizer()
DelimitedLineTokenizer
class for the
common case where the delimiter is a comma
.
DelimitedLineTokenizer(char)
,
DELIMITER_COMMA
public DelimitedLineTokenizer(char delimiter)
DelimitedLineTokenizer
class.
delimiter
- the desired delimiterMethod Detail |
---|
public void setDelimiter(char delimiter)
delimiter
- public void setIncludedFields(int[] includedFields)
includedFields
- the included fields to setpublic final void setQuoteCharacter(char quoteCharacter)
quoteCharacter
- the quoteCharacter to setDEFAULT_QUOTE_CHARACTER
protected List<String> doTokenize(String line)
line
.
doTokenize
in class AbstractLineTokenizer
line
- the line to be tokenized
protected boolean isQuoteCharacter(char c)
c
- the character to be checked
true
if the supplied character is an quote charactersetQuoteCharacter(char)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |