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


Java ListItemReader类代码示例

本文整理汇总了Java中org.springframework.batch.item.support.ListItemReader的典型用法代码示例。如果您正苦于以下问题:Java ListItemReader类的具体用法?Java ListItemReader怎么用?Java ListItemReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: itemReader

import org.springframework.batch.item.support.ListItemReader; //导入依赖的package包/类
@Bean
@StepScope
public ItemReader<String> itemReader() {
	final List<String> items = IntStream.range(0, 1000).mapToObj(String::valueOf).collect(toList());

	return new ListItemReader<String>(items);
}
 
开发者ID:phjardas,项目名称:spring-batch-tools,代码行数:8,代码来源:TestJobConfig.java

示例2: firstReader

import org.springframework.batch.item.support.ListItemReader; //导入依赖的package包/类
@Bean
@StepScope
public ItemReader<String> firstReader(@Value("#{jobParameters[message]}") String text) {
    log.info("+++ r-r-r  {} ", text);
  return new ListItemReader<>(Lists.newArrayList(text));
}
 
开发者ID:przodownikR1,项目名称:springBatchBootJavaConfigkata,代码行数:7,代码来源:JobConfig.java

示例3: reader

import org.springframework.batch.item.support.ListItemReader; //导入依赖的package包/类
@Bean
public ItemReader<String> reader() {
	return new ListItemReader<String>(Arrays.asList("1", "2", "3"));
}
 
开发者ID:dickerpulli,项目名称:spring-batch-admin-spring-boot,代码行数:5,代码来源:TestBatchConfiguration.java

示例4: createJsonListReader

import org.springframework.batch.item.support.ListItemReader; //导入依赖的package包/类
/**
 * Reads a file containing direcly an array of objects which should be converted to a list of {@code clazz} elements.
 *
 * @param resource the resource wich a JSON array of objects where each object should be converted to an instance of {@code clazz}
 * @param clazz the type element the ItemReader should return
 * @param <T> the type element the ItemReader should return
 * @return item reader
 * @throws IOException in case the resource reading did not work or the JSON mapping
 */
public static <T> ItemReader<T> createJsonListReader(final Resource resource, final Class<T> clazz) throws IOException {
    final List<T> listFromJsonResource = createJsonList(resource, clazz);
    return new ListItemReader<>(listFromJsonResource);
}
 
开发者ID:commercetools,项目名称:commercetools-sunrise-data,代码行数:14,代码来源:JsonUtils.java


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