public class GenericRecordProcessor<T extends Model<?>> extends Object implements RecordProcessor<T>, ImportOptionsAware, DataTypeSupport
RecordProcessor implementation, which can be used to handle most file import jobs.
The doBefore and doAfter methods can be overridden to handle data set or data
file metadata persistence, pre/post-processing, or other maintenance tasks. Uses a basic
BasicImportOptions instance to set import parameters, and identify the directory to store
all temporary files.| Constructor and Description |
|---|
GenericRecordProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure()
Performs configuration steps after bean creation.
|
void |
configureComponents()
Assigns options and metadata objects to the individual processing components that are expecting
them.
|
void |
doAfter(Object... args)
To be executed after the main component method is called for the last time.
|
void |
doBefore(Object... args)
To be executed before the main component method is first called.
|
RecordImporter |
getImporter() |
ImportOptions |
getImportOptions() |
Class<T> |
getModel()
Returns the model class reference.
|
RecordReader<T> |
getReader() |
List<String> |
getSupportedDataTypes()
Returns all of the supported data type identifiers.
|
org.springframework.validation.Validator |
getValidator() |
RecordWriter<T> |
getWriter() |
boolean |
isSupportedDataType(String dataType)
Returns true if the implementing class supports the input data type identifier.
|
void |
run(Object... args)
|
void |
setImporter(RecordImporter importer) |
void |
setImportOptions(BasicImportOptions options) |
void |
setImportOptions(ImportOptions options) |
void |
setModel(Class<T> model) |
void |
setReader(RecordReader<T> reader) |
void |
setSupportedDataTypes(Iterable<String> dataTypes)
Sets all of the supported data type identifiers.
|
void |
setValidator(org.springframework.validation.Validator validator) |
void |
setWriter(RecordWriter<T> writer) |
public void doBefore(Object... args) throws DataImportException
doBefore in interface DataImportComponentargs - an array of objects of any type.DataImportException@PostConstruct public void configure()
public void configureComponents()
doBefore() method.configureComponents in interface RecordProcessor<T extends Model<?>>public void doAfter(Object... args) throws DataImportException
doAfter in interface DataImportComponentargs - an array of objects of any type.DataImportExceptionpublic void run(Object... args) throws DataImportException
run in interface RecordProcessor<T extends Model<?>>args - DataImportExceptionpublic boolean isSupportedDataType(String dataType)
DataTypeSupportisSupportedDataType in interface DataTypeSupportpublic void setSupportedDataTypes(Iterable<String> dataTypes)
DataTypeSupportsetSupportedDataTypes in interface DataTypeSupportpublic List<String> getSupportedDataTypes()
DataTypeSupportgetSupportedDataTypes in interface DataTypeSupportpublic Class<T> getModel()
ModelSupportgetModel in interface ModelSupport<T extends Model<?>>public RecordReader<T> getReader()
getReader in interface RecordProcessor<T extends Model<?>>public void setReader(RecordReader<T> reader)
setReader in interface RecordProcessor<T extends Model<?>>public org.springframework.validation.Validator getValidator()
getValidator in interface RecordProcessor<T extends Model<?>>public void setValidator(org.springframework.validation.Validator validator)
setValidator in interface RecordProcessor<T extends Model<?>>public RecordWriter<T> getWriter()
getWriter in interface RecordProcessor<T extends Model<?>>public void setWriter(RecordWriter<T> writer)
setWriter in interface RecordProcessor<T extends Model<?>>public RecordImporter getImporter()
getImporter in interface RecordProcessor<T extends Model<?>>public void setImporter(RecordImporter importer)
setImporter in interface RecordProcessor<T extends Model<?>>public ImportOptions getImportOptions()
public void setImportOptions(ImportOptions options)
setImportOptions in interface ImportOptionsAwarepublic void setImportOptions(BasicImportOptions options)
Copyright © 2016. All rights reserved.