org.springframework.batch.item.support.ListItemReader Java Examples

The following examples show how to use org.springframework.batch.item.support.ListItemReader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ItemReaderConfigure.java    From SpringAll with MIT License 6 votes vote down vote up
@Bean
public ListItemReader<TestData> simpleReader() {
    List<TestData> data = new ArrayList<>();
    TestData testData1 = new TestData();
    testData1.setId(1);
    testData1.setField1("11");
    testData1.setField2("12");
    testData1.setField3("13");
    data.add(testData1);
    TestData testData2 = new TestData();
    testData2.setId(2);
    testData2.setField1("21");
    testData2.setField2("22");
    testData2.setField3("23");
    data.add(testData2);
    return new ListItemReader<>(data);
}
 
Example #2
Source File: ItemReaderConfigure.java    From SpringAll with MIT License 6 votes vote down vote up
@Bean
public ListItemReader<TestData> simpleReader() {
    List<TestData> data = new ArrayList<>();
    TestData testData1 = new TestData();
    testData1.setId(1);
    testData1.setField1("11");
    testData1.setField2("12");
    testData1.setField3("13");
    data.add(testData1);
    TestData testData2 = new TestData();
    testData2.setId(2);
    testData2.setField1("21");
    testData2.setField2("22");
    testData2.setField3("23");
    data.add(testData2);
    TestData testData3 = new TestData();
    testData3.setId(3);
    testData3.setField1("31");
    testData3.setField2("32");
    testData3.setField3("");
    data.add(testData3);
    return new ListItemReader<>(data);
}
 
Example #3
Source File: SingleStepJobAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {
	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "baz"));

	return new ListItemReader<>(items);
}
 
Example #4
Source File: FlatFileItemWriterAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {

	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "baz"));

	return new ListItemReader<>(items);
}
 
Example #5
Source File: FlatFileItemWriterAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {

	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "baz"));

	return new ListItemReader<>(items);
}
 
Example #6
Source File: FlatFileItemWriterAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {

	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "baz"));

	return new ListItemReader<>(items);
}
 
Example #7
Source File: FlatFileItemWriterAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {

	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "baz"));

	return new ListItemReader<>(items);
}
 
Example #8
Source File: FlatFileItemWriterAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {

	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "tooLong"));

	return new ListItemReader<>(items);
}
 
Example #9
Source File: FlatFileItemWriterAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Bean
public ListItemReader<Map<Object, Object>> itemReader() {

	List<Map<Object, Object>> items = new ArrayList<>(3);

	items.add(Collections.singletonMap("item", "foo"));
	items.add(Collections.singletonMap("item", "bar"));
	items.add(Collections.singletonMap("item", "baz"));

	return new ListItemReader<>(items);
}
 
Example #10
Source File: TestBatchConfiguration.java    From spring-batch-admin-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
public ItemReader<String> reader() {
	return new ListItemReader<String>(Arrays.asList("1", "2", "3"));
}
 
Example #11
Source File: RestartJobDemo.java    From SpringAll with MIT License 4 votes vote down vote up
private ListItemReader<String> listItemReader() {
    ArrayList<String> datas = new ArrayList<>();
    IntStream.range(0, 5).forEach(i -> datas.add(String.valueOf(i)));
    return new ListItemReader<>(datas);
}
 
Example #12
Source File: RetryExceptionJobDemo.java    From SpringAll with MIT License 4 votes vote down vote up
private ListItemReader<String> listItemReader() {
    ArrayList<String> datas = new ArrayList<>();
    IntStream.range(0, 5).forEach(i -> datas.add(String.valueOf(i)));
    return new ListItemReader<>(datas);
}
 
Example #13
Source File: TransactionJobDemo.java    From SpringAll with MIT License 4 votes vote down vote up
private ListItemReader<String> listItemReader() {
    ArrayList<String> datas = new ArrayList<>();
    IntStream.range(0, 5).forEach(i -> datas.add(String.valueOf(i)));
    return new ListItemReader<>(datas);
}
 
Example #14
Source File: SkipExceptionJobDemo.java    From SpringAll with MIT License 4 votes vote down vote up
private ListItemReader<String> listItemReader() {
    ArrayList<String> datas = new ArrayList<>();
    IntStream.range(0, 5).forEach(i -> datas.add(String.valueOf(i)));
    return new ListItemReader<>(datas);
}