Class PatternMatchingCompositeLineTokenizer
- java.lang.Object
- org.springframework.batch.item.file.transform.PatternMatchingCompositeLineTokenizer
- All Implemented Interfaces:
LineTokenizer,org.springframework.beans.factory.InitializingBean
public class PatternMatchingCompositeLineTokenizer extends java.lang.Object implements LineTokenizer, org.springframework.beans.factory.InitializingBean
ALineTokenizerimplementation that stores a mapping of String patterns to delegateLineTokenizers. 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 delegateLineTokenizerwill be used. Patterns are sorted starting with the most specific, and the first match succeeds.- Author:
- Ben Hale, Dan Garrette, Dave Syer
Constructor Summary
Constructors Constructor Description PatternMatchingCompositeLineTokenizer()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voidsetTokenizers(java.util.Map<java.lang.String,LineTokenizer> tokenizers)FieldSettokenize(java.lang.String line)Yields the tokens resulting from the splitting of the suppliedline.
Method Detail
tokenize
public FieldSet tokenize(java.lang.String line)
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 (can benull)- Returns:
- the resulting tokens
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
setTokenizers
public void setTokenizers(java.util.Map<java.lang.String,LineTokenizer> tokenizers)