org.springframework.batch.sample.domain.trade
Class CompositeCustomerUpdateLineTokenizer
java.lang.Object
org.springframework.batch.core.listener.StepExecutionListenerSupport
org.springframework.batch.sample.domain.trade.CompositeCustomerUpdateLineTokenizer
- All Implemented Interfaces:
- StepExecutionListener, StepListener, org.springframework.batch.item.file.transform.LineTokenizer
public class CompositeCustomerUpdateLineTokenizer
- extends StepExecutionListenerSupport
- implements org.springframework.batch.item.file.transform.LineTokenizer
Composite LineTokenizer that delegates the tokenization of a line to one of two potential
tokenizers. The file format in this case uses one character, either F, A, U, or D to indicate
whether or not the line is an a footer record, or a customer add, update, or delete, and
will delegate accordingly.
- Since:
- 2.0
- Author:
- Lucas Ward
|
Method Summary |
void |
beforeStep(StepExecution stepExecution)
|
void |
setCustomerTokenizer(org.springframework.batch.item.file.transform.LineTokenizer customerTokenizer)
Set the LineTokenizer that will be used to tokenize any lines that begin with
A, U, or D, and are thus a customer operation. |
void |
setFooterTokenizer(org.springframework.batch.item.file.transform.LineTokenizer footerTokenizer)
Set the LineTokenizer that will be used to tokenize any lines that being with
F and is thus a footer record. |
org.springframework.batch.item.file.transform.FieldSet |
tokenize(String line)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompositeCustomerUpdateLineTokenizer
public CompositeCustomerUpdateLineTokenizer()
tokenize
public org.springframework.batch.item.file.transform.FieldSet tokenize(String line)
- Specified by:
tokenize in interface org.springframework.batch.item.file.transform.LineTokenizer
beforeStep
public void beforeStep(StepExecution stepExecution)
- Specified by:
beforeStep in interface StepExecutionListener- Overrides:
beforeStep in class StepExecutionListenerSupport
setCustomerTokenizer
public void setCustomerTokenizer(org.springframework.batch.item.file.transform.LineTokenizer customerTokenizer)
- Set the
LineTokenizer that will be used to tokenize any lines that begin with
A, U, or D, and are thus a customer operation.
- Parameters:
customerTokenizer -
setFooterTokenizer
public void setFooterTokenizer(org.springframework.batch.item.file.transform.LineTokenizer footerTokenizer)
- Set the
LineTokenizer that will be used to tokenize any lines that being with
F and is thus a footer record.
- Parameters:
footerTokenizer -
Copyright © 2013. All Rights Reserved.