public class PatternMatchingCompositeLineTokenizer extends java.lang.Object implements LineTokenizer, org.springframework.beans.factory.InitializingBean
LineTokenizer
implementation that stores a mapping of String
patterns to delegate LineTokenizer
s. Each line tokenized will be
checked to see if it matches a pattern. If the line matches a key in the map
of delegates, then the corresponding delegate LineTokenizer
will be
used. Patterns are sorted starting with the most specific, and the first
match succeeds.Constructor and Description |
---|
PatternMatchingCompositeLineTokenizer() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
setTokenizers(java.util.Map<java.lang.String,LineTokenizer> tokenizers) |
FieldSet |
tokenize(java.lang.String line)
Yields the tokens resulting from the splitting of the supplied
line . |
public PatternMatchingCompositeLineTokenizer()
public FieldSet tokenize(@Nullable java.lang.String line)
LineTokenizer
line
.tokenize
in interface LineTokenizer
line
- the line to be tokenized (can be null
)public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void setTokenizers(java.util.Map<java.lang.String,LineTokenizer> tokenizers)