public abstract class AbstractLineTokenizer extends java.lang.Object implements LineTokenizer
LineTokenizer
implementations such as dealing with names and actual construction of
FieldSet
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
names |
Constructor and Description |
---|
AbstractLineTokenizer() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.util.List<java.lang.String> |
doTokenize(java.lang.String line) |
boolean |
hasNames() |
protected boolean |
isStrict()
Provides access to the strict flag for subclasses if needed.
|
void |
setFieldSetFactory(FieldSetFactory fieldSetFactory)
Factory for
FieldSet instances. |
void |
setNames(java.lang.String... names)
Setter for column names.
|
void |
setStrict(boolean strict)
Public setter for the strict flag.
|
FieldSet |
tokenize(java.lang.String line)
Yields the tokens resulting from the splitting of the supplied
line . |
public void setStrict(boolean strict)
Range
, columns, etc.) in LineTokenizer
.
If false then lines with less tokens will be tolerated and padded with
empty columns, and lines with more tokens will
simply be truncated.strict
- the strict flag to setprotected boolean isStrict()
public void setFieldSetFactory(FieldSetFactory fieldSetFactory)
FieldSet
instances. Can be injected by clients to
customize the default number and date formats.fieldSetFactory
- the FieldSetFactory
to setpublic void setNames(java.lang.String... names)
names
- names of each columnpublic boolean hasNames()
true
if column names have been specifiedsetNames(String[])
public FieldSet tokenize(java.lang.String line)
line
.tokenize
in interface LineTokenizer
line
- the line to be tokenized (can be null
)protected abstract java.util.List<java.lang.String> doTokenize(java.lang.String line)