RESOLVED - issue BATCH-779: RFC: make FieldSetMapper and LineAggregator extend ItemProcessor

http://jira.springframework.org/browse/BATCH-779

Updated FieldSetMapper interface method to mapFieldSet from simply map, in order to be more consistent with other *Mapper implementations.
This commit is contained in:
lucasward
2008-10-09 21:10:14 +00:00
parent a027767792
commit f1ed1187df
8 changed files with 25 additions and 25 deletions

View File

@@ -102,7 +102,7 @@ public class BeanWrapperFieldSetMapper<T> extends DefaultPropertyEditorRegistrar
/**
* The bean name (id) for an object that can be populated from the field set
* that will be passed into {@link #map(FieldSet)}. Typically a
* that will be passed into {@link #mapFieldSet(FieldSet)}. Typically a
* prototype scoped bean so that a new instance is returned for each field
* set mapped.
*
@@ -118,7 +118,7 @@ public class BeanWrapperFieldSetMapper<T> extends DefaultPropertyEditorRegistrar
/**
* Public setter for the type of bean to create instead of using a prototype
* bean. An object of this type will be created from its default constructor
* for every call to {@link #map(FieldSet)}.<br/>
* for every call to {@link #mapFieldSet(FieldSet)}.<br/>
*
* Either this property or the prototype bean name must be specified, but
* not both.
@@ -153,10 +153,10 @@ public class BeanWrapperFieldSetMapper<T> extends DefaultPropertyEditorRegistrar
* the {@link DataBinder} from {@link #createBinder(Object)} has errors
* after binding).
*
* @see org.springframework.batch.item.file.mapping.FieldSetMapper#map(FieldSet)
* @see org.springframework.batch.item.file.mapping.FieldSetMapper#mapFieldSet(FieldSet)
*/
@SuppressWarnings("unchecked")
public T map(FieldSet fs) {
public T mapFieldSet(FieldSet fs) {
T copy = getBean();
DataBinder binder = createBinder(copy);
binder.bind(new MutablePropertyValues(getBeanProperties(copy, fs.getProperties())));

View File

@@ -17,7 +17,7 @@ public class DefaultLineMapper<T> implements LineMapper<T> {
private FieldSetMapper<T> fieldSetMapper;
public T mapLine(String line, int lineNumber) throws Exception {
return fieldSetMapper.map(tokenizer.tokenize(line));
return fieldSetMapper.mapFieldSet(tokenizer.tokenize(line));
}
public void setLineTokenizer(LineTokenizer tokenizer) {

View File

@@ -33,5 +33,5 @@ public interface FieldSetMapper<T> {
*
* @param fieldSet the {@link FieldSet} to map
*/
T map(FieldSet fieldSet);
T mapFieldSet(FieldSet fieldSet);
}

View File

@@ -31,7 +31,7 @@ public class PassThroughFieldSetMapper implements FieldSetMapper<FieldSet> {
* org.springframework.batch.item.file.FieldSetMapper#mapLine(org.springframework
* .batch.io.file.FieldSet)
*/
public FieldSet map(FieldSet fs) {
public FieldSet mapFieldSet(FieldSet fs) {
return fs;
}