|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.item.ItemStreamSupport
net.sf.bacchus.spring.RecordProcessorSupport<I,O>
I - the type of input Record this processes.O - the type of output this emits.public class RecordProcessorSupport<I extends Record,O>
Base ItemProcessor that takes ACH records as input.
The base processing method dispatches each item to a
method that is specialized for the record type. The default implementations
of those methods delegate to the default
processing, which returns null. Therefore, a simple instantiation of
this class will return null for every record.
| Constructor Summary | |
|---|---|
RecordProcessorSupport()
|
|
| Method Summary | |
|---|---|
boolean |
isAllowUnrecognized()
Gets whether unrecognized records should be passed through untouched. |
protected String |
key(String base)
Generates a name that uniquely identifies an entry for this instance in the ExecutionContext. |
O |
process(I item)
Dispatches each input item to the appropriate processXXX method. |
protected O |
processAddenda(I item)
Processes an addenda record. |
protected O |
processCompanyBatchControl(I item)
Processes a company/batch control record. |
protected O |
processCompanyBatchHeader(I item)
Processes a company/batch header record. |
protected O |
processDefault(I item)
Perform default processing on an item. |
protected O |
processDetail(I item)
Processes a detail record. |
protected O |
processFileControl(I item)
Processes a file control record. |
protected O |
processFileHeader(I item)
Processes a file header record. |
protected O |
processFiller(I item)
Processes a filler record. |
void |
setAllowUnrecognized(boolean allowUnrecognized)
Sets whether unrecognized records should be passed through untouched. |
void |
setName(String name)
Sets name used to uniquely identify this instance's entries in shared ExecutionContext. |
| Methods inherited from class org.springframework.batch.item.ItemStreamSupport |
|---|
close, open, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RecordProcessorSupport()
| Method Detail |
|---|
public boolean isAllowUnrecognized()
true then null input records will result in
null output records and records that return an unrecognized
record type will be passed to the
default processor. If this value is {code
false} then null records will result in NullPointerException and records that do not return a recognized
record type will result in
InvalidRecordException. The default value is false.
public void setAllowUnrecognized(boolean allowUnrecognized)
allowUnrecognized - whether unrecognized records should be passed
through untouched.
public O process(I item)
throws InvalidRecordException
item to the appropriate processXXX method.
process in interface org.springframework.batch.item.ItemProcessor<I extends Record,O>item -
InvalidRecordException - if the record is not recognized and
isAllowUnrecognized() is false.
NullPointerException - if the record is null and
isAllowUnrecognized() is false.
protected O processDefault(I item)
throws InvalidRecordException
item - the item to process.
null.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processFileHeader(I item)
throws InvalidRecordException
item - the item, where item.getRecordType() is guaranteed always to return
Header.FILE_HEADER_RECORD.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processCompanyBatchHeader(I item)
throws InvalidRecordException
item - the item, where item.getRecordType() is guaranteed always to return
Header.BATCH_HEADER_RECORD.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processDetail(I item)
throws InvalidRecordException
item - the item, where item.getRecordType() is guaranteed always to return
Detail.DETAIL_RECORD.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processAddenda(I item)
throws InvalidRecordException
item - the item, where item.getRecordType() is guaranteed always to return
Addenda.ADDENDA_RECORD.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processCompanyBatchControl(I item)
throws InvalidRecordException
item - the item, where item.getRecordType() is guaranteed always to return
Control.BATCH_CONTROL_RECORD.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processFileControl(I item)
throws InvalidRecordException
item - the item, where item.getRecordType() is guaranteed always to return
Control.FILE_CONTROL_RECORD.
InvalidRecordException - if the record is invalid and cannot be
processed.
protected O processFiller(I item)
throws InvalidRecordException
item - the item.
InvalidRecordException - if the record is invalid and cannot be
processed.public void setName(String name)
ExecutionContext.
name - the name of this instance.protected String key(String base)
ExecutionContext.
base - the base key name shared by all instances.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||