Class PatternMatchingCompositeLineTokenizer
java.lang.Object
org.springframework.batch.infrastructure.item.file.transform.PatternMatchingCompositeLineTokenizer
- All Implemented Interfaces:
LineTokenizer
A
LineTokenizer implementation that stores a mapping of String patterns to
delegate LineTokenizers. 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.- Author:
- Ben Hale, Dan Garrette, Dave Syer, Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionPatternMatchingCompositeLineTokenizer(Map<String, LineTokenizer> tokenizers) Construct aPatternMatchingCompositeLineTokenizerwith the provided map of tokenizers. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetTokenizers(Map<String, LineTokenizer> tokenizers) Yields the tokens resulting from the splitting of the suppliedline.
-
Constructor Details
-
PatternMatchingCompositeLineTokenizer
Construct aPatternMatchingCompositeLineTokenizerwith the provided map of tokenizers. The map must be non-empty.- Parameters:
tokenizers- the map of patterns to tokenizers- Since:
- 6.0
-
-
Method Details
-
tokenize
Description copied from interface:LineTokenizerYields the tokens resulting from the splitting of the suppliedline.- Specified by:
tokenizein interfaceLineTokenizer- Parameters:
line- the line to be tokenized- Returns:
- the resulting tokens
-
setTokenizers
-