REOPENED - BATCH-779: RFC: make FieldSetMapper and LineAggregator extend ItemProcessor
remove the "extends ItemProcessor" clauses
This commit is contained in:
@@ -153,7 +153,7 @@ 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#process(Object)
|
||||
* @see org.springframework.batch.item.file.mapping.FieldSetMapper#process(FieldSet)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T process(FieldSet fs) {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.batch.item.file.mapping;
|
||||
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
|
||||
/**
|
||||
* Interface that is used to map data obtained from a {@link FieldSet} into an
|
||||
@@ -26,5 +25,7 @@ import org.springframework.batch.item.ItemProcessor;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public interface FieldSetMapper<T> extends ItemProcessor<FieldSet, T> {
|
||||
public interface FieldSetMapper<T> {
|
||||
|
||||
T process(FieldSet fieldSet);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.batch.item.file.transform;
|
||||
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
|
||||
|
||||
|
||||
@@ -25,5 +24,7 @@ import org.springframework.batch.item.ItemProcessor;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public interface LineAggregator<T> extends ItemProcessor<T, String>{
|
||||
public interface LineAggregator<T> {
|
||||
|
||||
String process(T item);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.batch.item.file.transform;
|
||||
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
import org.springframework.batch.item.file.mapping.FieldSet;
|
||||
|
||||
|
||||
@@ -27,5 +26,7 @@ import org.springframework.batch.item.file.mapping.FieldSet;
|
||||
* @author tomas.slanina
|
||||
*
|
||||
*/
|
||||
public interface LineTokenizer extends ItemProcessor<String, FieldSet> {
|
||||
public interface LineTokenizer {
|
||||
|
||||
FieldSet process(String line);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class PrefixMatchingCompositeLineTokenizer implements LineTokenizer {
|
||||
this.tokenizers = new LinkedHashMap<String, LineTokenizer>(tokenizers);
|
||||
}
|
||||
|
||||
public FieldSet process(String line) throws Exception {
|
||||
public FieldSet process(String line) {
|
||||
|
||||
if (line == null) {
|
||||
return new DefaultFieldSet(new String[0]);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class RecursiveCollectionLineAggregator<T> implements LineAggregator<Coll
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.batch.item.file.transform.LineAggregator#aggregate(java.lang.Object)
|
||||
*/
|
||||
public String process(Collection<T> items) throws Exception {
|
||||
public String process(Collection<T> items) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (T value : items) {
|
||||
builder.append(delegate.process(value) + LINE_SEPARATOR);
|
||||
|
||||
Reference in New Issue
Block a user