RESOLVED - issue BATCH-977: DefaultLineMapper should check for its required dependencies
This commit is contained in:
@@ -2,6 +2,8 @@ package org.springframework.batch.item.file.mapping;
|
||||
|
||||
import org.springframework.batch.item.file.transform.FieldSet;
|
||||
import org.springframework.batch.item.file.transform.LineTokenizer;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Two-phase {@link LineMapper} implementation consisting of tokenization of the
|
||||
@@ -11,7 +13,7 @@ import org.springframework.batch.item.file.transform.LineTokenizer;
|
||||
*
|
||||
* @param <T> type of the item
|
||||
*/
|
||||
public class DefaultLineMapper<T> implements LineMapper<T> {
|
||||
public class DefaultLineMapper<T> implements LineMapper<T>, InitializingBean {
|
||||
|
||||
private LineTokenizer tokenizer;
|
||||
|
||||
@@ -29,4 +31,9 @@ public class DefaultLineMapper<T> implements LineMapper<T> {
|
||||
this.fieldSetMapper = fieldSetMapper;
|
||||
}
|
||||
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(tokenizer, "The LineTokenizer must be set");
|
||||
Assert.notNull(fieldSetMapper, "The FieldSetMapper must be set");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user