本文整理汇总了Java中org.springframework.batch.item.file.transform.DelimitedLineTokenizer.setDelimiter方法的典型用法代码示例。如果您正苦于以下问题:Java DelimitedLineTokenizer.setDelimiter方法的具体用法?Java DelimitedLineTokenizer.setDelimiter怎么用?Java DelimitedLineTokenizer.setDelimiter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.batch.item.file.transform.DelimitedLineTokenizer
的用法示例。
在下文中一共展示了DelimitedLineTokenizer.setDelimiter方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
DelimitedLineTokenizer lineTokenizer = new DelimitedLineTokenizer();
lineTokenizer.setDelimiter('\t');
lineTokenizer.setNames(new String[] {"foo","bar"});
lineTokenizer.setStrict(false);
DefaultLineMapper<FieldSet> lineMapper = new DefaultLineMapper<FieldSet>();
lineMapper.setLineTokenizer(lineTokenizer);
lineMapper.setFieldSetMapper(new PassThroughFieldSetMapper());
flatFileItemReader = new FlatFileItemReader<FieldSet>();
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.setResource(new ClassPathResource("org/emonocot/bom.txt"));
flatFileItemReader.setBufferedReaderFactory(new BOMIgnoringBufferedReaderFactory());
flatFileItemReader.afterPropertiesSet();
flatFileItemReader.open(new ExecutionContext());
}
示例2: newDefaultLineMapper
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
private DefaultLineMapper<T> newDefaultLineMapper() {
final DefaultLineMapper<T> lineMapper = new DefaultLineMapper<T>();
final DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
if (delimiter != null) {
tokenizer.setDelimiter(delimiter);
}
if (names != null) {
tokenizer.setNames(names);
}
if (strict != null) {
tokenizer.setStrict(strict);
}
if (fieldSetFactory != null) {
tokenizer.setFieldSetFactory(fieldSetFactory);
}
lineMapper.setLineTokenizer(tokenizer);
if (fieldSetMapper != null) {
lineMapper.setFieldSetMapper(fieldSetMapper);
}
lineMapper.afterPropertiesSet();
return lineMapper;
}
示例3: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
DelimitedLineTokenizer lineTokenizer = new DelimitedLineTokenizer();
lineTokenizer.setDelimiter(DelimitedLineTokenizer.DELIMITER_TAB);
lineTokenizer.setNames(new String[] {"foo","bar"});
lineTokenizer.setStrict(false);
DefaultLineMapper<FieldSet> lineMapper = new DefaultLineMapper<FieldSet>();
lineMapper.setLineTokenizer(lineTokenizer);
lineMapper.setFieldSetMapper(new PassThroughFieldSetMapper());
flatFileItemReader = new FlatFileItemReader<FieldSet>();
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.setResource(new ClassPathResource("org/emonocot/bom.txt"));
flatFileItemReader.setBufferedReaderFactory(new BOMIgnoringBufferedReaderFactory());
flatFileItemReader.afterPropertiesSet();
flatFileItemReader.open(new ExecutionContext());
}
示例4: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
/**
*
*/
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://purl.org/dc/terms/type",
"http://purl.org/dc/elements/1.1/source",
"http://purl.org/dc/terms/modified",
"http://purl.org/dc/terms/create",
"http://purl.org/dc/terms/creator",
"http://purl.org/dc/terms/description",
"http://purl.org/dc/terms/references",
"http://purl.org/dc/terms/source"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter('\t');
tokenizer.setNames(names);
taxonService = EasyMock.createMock(TaxonService.class);
conversionService = EasyMock.createMock(ConversionService.class);
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setConversionService(conversionService);
HtmlSanitizer htmlSanitizer = new HtmlSanitizer();
htmlSanitizer.afterPropertiesSet();
fieldSetMapper.setHtmlSanitizer(htmlSanitizer);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setTaxonService(taxonService);
DefaultLineMapper<Description> lineMapper
= new DefaultLineMapper<Description>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例5: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://purl.org/dc/terms/type",
"http://purl.org/dc/elements/1.1/source",
"http://purl.org/dc/terms/modified",
"http://purl.org/dc/terms/create",
"http://purl.org/dc/terms/creator",
"http://purl.org/dc/terms/description",
"http://purl.org/dc/terms/references",
"http://purl.org/dc/terms/source"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(DelimitedLineTokenizer.DELIMITER_TAB);
tokenizer.setNames(names);
taxonService = createMock(TaxonService.class);
conversionService = createMock(ConversionService.class);
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setTaxonService(taxonService);
DefaultLineMapper<Description> lineMapper = new DefaultLineMapper<Description>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例6: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://rs.tdwg.org/dwc/terms/scientificName",
"http://rs.tdwg.org/dwc/terms/scientificNameID",
"http://rs.tdwg.org/dwc/terms/scientificNameAuthorship",
"http://rs.tdwg.org/dwc/terms/taxonRank",
"http://rs.tdwg.org/dwc/terms/taxonomicStatus",
"http://rs.tdwg.org/dwc/terms/parentNameUsageID",
"http://rs.tdwg.org/dwc/terms/acceptedNameUsageID",
"http://rs.tdwg.org/dwc/terms/genus",
"http://rs.tdwg.org/dwc/terms/subgenus",
"http://rs.tdwg.org/dwc/terms/specificEpithet",
"http://rs.tdwg.org/dwc/terms/infraspecificEpithet",
"http://rs.tdwg.org/dwc/terms/nomenclaturalStatus",
"http://purl.org/dc/terms/modified",
"http://purl.org/dc/terms/source"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter('\t');
tokenizer.setNames(names);
taxonService = EasyMock.createMock(TaxonService.class);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new StringToIsoDateTimeConverter());
converters.add(new TaxonomicStatusConverter());
converters.add(new RankConverter());
converters.add(new NomenclaturalStatusConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setConversionService(conversionService);
DefaultLineMapper<Taxon> lineMapper
= new DefaultLineMapper<Taxon>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例7: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
/**
*
*/
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://rs.tdwg.org/dwc/terms/scientificName",
"http://rs.tdwg.org/dwc/terms/vernacularName",
"http://rs.tdwg.org/dwc/terms/taxonomicStatus",
"http://rs.tdwg.org/dwc/terms/taxonRank",
"http://rs.tdwg.org/dwc/terms/scientificNameAuthorship",
"http://purl.org/dc/terms/bibliographicCitation",
"http://rs.tdwg.org/dwc/terms/parentNameUsageID"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(',');
tokenizer.setQuoteCharacter('\"');
tokenizer.setNames(names);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new TaxonomicStatusConverter());
converters.add(new RankConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
taxonService = EasyMock.createMock(TaxonService.class);
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
DefaultLineMapper<Taxon> lineMapper
= new DefaultLineMapper<Taxon>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例8: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
/**
* @throws Exception if there is a problem
*/
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://purl.org/dc/terms/modified",
"http://purl.org/dc/terms/created",
"http://purl.org/dc/terms/identifier",
"http://purl.org/dc/terms/bibliographicCitation",
"http://purl.org/dc/terms/type",
"http://purl.org/dc/terms/title",
"http://purl.org/ontology/bibo/volume",
"http://purl.org/ontology/bibo/number",
"http://purl.org/ontology/bibo/pages",
"http://purl.org/dc/terms/description",
"http://purl.org/dc/terms/date",
"http://purl.org/dc/terms/source",
"http://purl.org/dc/terms/creator"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter('\t');
tokenizer.setNames(names);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new ReferenceTypeConverter());
converters.add(new StringToIsoDateTimeConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
taxonService = EasyMock.createMock(TaxonService.class);
FieldSetMapper fieldSetMapper = new FieldSetMapper();
HtmlSanitizer htmlSanitizer = new HtmlSanitizer();
htmlSanitizer.afterPropertiesSet();
fieldSetMapper.setHtmlSanitizer(htmlSanitizer);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setTaxonService(taxonService);
DefaultLineMapper<Reference> lineMapper
= new DefaultLineMapper<Reference>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例9: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
/**
* @throws Exception if there is a problem
*/
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://purl.org/dc/terms/identifier",
"",
"http://purl.org/ontology/bibo/doi",
"http://purl.org/ontology/bibo/isbn",
"http://purl.org/ontology/bibo/issn",
"",
"",
"http://purl.org/dc/terms/bibliographicCitation",
"http://purl.org/dc/terms/title",
"http://purl.org/dc/terms/creator",
"http://purl.org/dc/terms/source",
"http://purl.org/dc/terms/description",
"http://purl.org/dc/terms/subject",
"http://purl.org/dc/terms/language",
"http://purl.org/dc/terms/type",
"http://purl.org/dc/terms/date",
"http://purl.org/dc/terms/created",
"http://purl.org/dc/terms/modified"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(',');
tokenizer.setQuoteCharacter('"');
tokenizer.setNames(names);
taxonService = EasyMock.createMock(TaxonService.class);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new ReferenceTypeConverter());
converters.add(new StringToIsoDateTimeConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
FieldSetMapper fieldSetMapper = new FieldSetMapper();
HtmlSanitizer htmlSanitizer = new HtmlSanitizer();
htmlSanitizer.afterPropertiesSet();
fieldSetMapper.setHtmlSanitizer(htmlSanitizer);
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setTaxonService(taxonService);
DefaultLineMapper<Reference> lineMapper
= new DefaultLineMapper<Reference>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例10: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://rs.tdwg.org/dwc/terms/scientificName",
"http://rs.tdwg.org/dwc/terms/scientificNameID",
"http://rs.tdwg.org/dwc/terms/scientificNameAuthorship",
"http://rs.tdwg.org/dwc/terms/taxonRank",
"http://rs.tdwg.org/dwc/terms/taxonomicStatus",
"http://rs.tdwg.org/dwc/terms/parentNameUsageID",
"http://rs.tdwg.org/dwc/terms/acceptedNameUsageID",
"http://rs.tdwg.org/dwc/terms/genus",
"http://rs.tdwg.org/dwc/terms/subgenus",
"http://rs.tdwg.org/dwc/terms/specificEpithet",
"http://rs.tdwg.org/dwc/terms/infraspecificEpithet",
"http://rs.tdwg.org/dwc/terms/nomenclaturalStatus",
"http://purl.org/dc/terms/modified",
"http://purl.org/dc/terms/source"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(DelimitedLineTokenizer.DELIMITER_TAB);
tokenizer.setNames(names);
taxonService = EasyMock.createMock(TaxonService.class);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new StringToIsoDateTimeConverter());
converters.add(new TaxonomicStatusConverter());
converters.add(new RankConverter());
converters.add(new NomenclaturalStatusConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setConversionService(conversionService);
DefaultLineMapper<Taxon> lineMapper
= new DefaultLineMapper<Taxon>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例11: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://rs.tdwg.org/dwc/terms/scientificName",
"http://rs.tdwg.org/dwc/terms/vernacularName",
"http://rs.tdwg.org/dwc/terms/taxonomicStatus",
"http://rs.tdwg.org/dwc/terms/taxonRank",
"http://rs.tdwg.org/dwc/terms/scientificNameAuthorship",
"http://purl.org/dc/terms/bibliographicCitation",
"http://rs.tdwg.org/dwc/terms/parentNameUsageID"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(DelimitedLineTokenizer.DELIMITER_COMMA);
tokenizer.setQuoteCharacter('\"');
tokenizer.setNames(names);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new TaxonomicStatusConverter());
converters.add(new RankConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
taxonService = EasyMock.createMock(TaxonService.class);
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
DefaultLineMapper<Taxon> lineMapper
= new DefaultLineMapper<Taxon>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例12: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://purl.org/dc/terms/modified",
"http://purl.org/dc/terms/created",
"http://purl.org/dc/terms/identifier",
"http://purl.org/dc/terms/bibliographicCitation",
"http://purl.org/dc/terms/type",
"http://purl.org/dc/terms/title",
"http://purl.org/ontology/bibo/volume",
"http://purl.org/ontology/bibo/number",
"http://purl.org/ontology/bibo/pages",
"http://purl.org/dc/terms/description",
"http://purl.org/dc/terms/date",
"http://purl.org/dc/terms/source",
"http://purl.org/dc/terms/creator"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(DelimitedLineTokenizer.DELIMITER_TAB);
tokenizer.setNames(names);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new ReferenceTypeConverter());
converters.add(new StringToIsoDateTimeConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
taxonService = EasyMock.createMock(TaxonService.class);
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setTaxonService(taxonService);
DefaultLineMapper<Reference> lineMapper
= new DefaultLineMapper<Reference>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}
示例13: setUp
import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; //导入方法依赖的package包/类
@Before
public final void setUp() throws Exception {
String[] names = new String[] {
"http://rs.tdwg.org/dwc/terms/taxonID",
"http://purl.org/dc/terms/identifier",
"",
"http://purl.org/ontology/bibo/doi",
"http://purl.org/ontology/bibo/isbn",
"http://purl.org/ontology/bibo/issn",
"",
"",
"http://purl.org/dc/terms/bibliographicCitation",
"http://purl.org/dc/terms/title",
"http://purl.org/dc/terms/creator",
"http://purl.org/dc/terms/source",
"http://purl.org/dc/terms/description",
"http://purl.org/dc/terms/subject",
"http://purl.org/dc/terms/language",
"http://purl.org/dc/terms/type",
"http://purl.org/dc/terms/date",
"http://purl.org/dc/terms/created",
"http://purl.org/dc/terms/modified"
};
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setDelimiter(DelimitedLineTokenizer.DELIMITER_COMMA);
tokenizer.setQuoteCharacter('"');
tokenizer.setNames(names);
taxonService = EasyMock.createMock(TaxonService.class);
Set<Converter> converters = new HashSet<Converter>();
converters.add(new ReferenceTypeConverter());
converters.add(new StringToIsoDateTimeConverter());
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
factoryBean.setConverters(converters);
factoryBean.afterPropertiesSet();
ConversionService conversionService = factoryBean.getObject();
FieldSetMapper fieldSetMapper = new FieldSetMapper();
fieldSetMapper.setConversionService(conversionService);
fieldSetMapper.setFieldNames(names);
fieldSetMapper.setDefaultValues(new HashMap<String, String>());
fieldSetMapper.setTaxonService(taxonService);
DefaultLineMapper<Reference> lineMapper
= new DefaultLineMapper<Reference>();
lineMapper.setFieldSetMapper(fieldSetMapper);
lineMapper.setLineTokenizer(tokenizer);
flatFileItemReader.setEncoding("UTF-8");
flatFileItemReader.setLinesToSkip(0);
flatFileItemReader.setResource(content);
flatFileItemReader.setLineMapper(lineMapper);
flatFileItemReader.afterPropertiesSet();
}