RESOLVED - issue BATCH-389: Two samples could make use of our ValidatingItemReader instead of DelegatingItemReader.

http://jira.springframework.org/browse/BATCH-389
This commit is contained in:
robokaso
2008-03-05 14:15:13 +00:00
parent 840d30426a
commit 69e3878501
3 changed files with 110 additions and 128 deletions

View File

@@ -24,7 +24,6 @@ import org.springframework.batch.core.domain.StepExecution;
import org.springframework.batch.io.file.mapping.FieldSet;
import org.springframework.batch.io.file.mapping.FieldSetMapper;
import org.springframework.batch.item.reader.DelegatingItemReader;
import org.springframework.batch.item.validator.Validator;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.domain.Customer;
@@ -55,8 +54,6 @@ public class OrderItemReader extends DelegatingItemReader {
private FieldSetMapper shippingMapper;
private Validator validator;
/**
* @throws Exception
* @see org.springframework.batch.item.ItemReader#read()
@@ -68,11 +65,8 @@ public class OrderItemReader extends DelegatingItemReader {
process((FieldSet) super.read());
}
if (order != null) {
log.info("Mapped: " + order);
validator.validate(order);
}
log.info("Mapped: " + order);
Object result = order;
order = null;
@@ -204,8 +198,4 @@ public class OrderItemReader extends DelegatingItemReader {
this.shippingMapper = shippingMapper;
}
public void setValidator(Validator validator) {
this.validator = validator;
}
}