当前位置: 首页>>代码示例>>Java>>正文


Java DelimitedLineTokenizer.setQuoteCharacter方法代码示例

本文整理汇总了Java中org.springframework.batch.item.file.transform.DelimitedLineTokenizer.setQuoteCharacter方法的典型用法代码示例。如果您正苦于以下问题:Java DelimitedLineTokenizer.setQuoteCharacter方法的具体用法?Java DelimitedLineTokenizer.setQuoteCharacter怎么用?Java DelimitedLineTokenizer.setQuoteCharacter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.batch.item.file.transform.DelimitedLineTokenizer的用法示例。


在下文中一共展示了DelimitedLineTokenizer.setQuoteCharacter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:46,代码来源:ScratchpadExportTaxonParsingTest.java

示例2: 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();
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:62,代码来源:ScratchpadReferenceParsingTest.java

示例3: 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();
}
 
开发者ID:RBGKew,项目名称:powop,代码行数:43,代码来源:ScratchpadExportTaxonParsingTest.java

示例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/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();
}
 
开发者ID:RBGKew,项目名称:powop,代码行数:56,代码来源:ScratchpadReferenceParsingTest.java


注:本文中的org.springframework.batch.item.file.transform.DelimitedLineTokenizer.setQuoteCharacter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。