|
1 | 1 | /*
|
2 |
| - * Copyright 2006-2021 the original author or authors. |
| 2 | + * Copyright 2006-2022 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
20 | 20 | import java.util.HashSet;
|
21 | 21 | import java.util.LinkedHashSet;
|
22 | 22 | import java.util.Set;
|
23 |
| -import java.util.function.Function; |
24 | 23 |
|
25 | 24 | import org.springframework.batch.core.ChunkListener;
|
26 | 25 | import org.springframework.batch.core.ItemProcessListener;
|
|
47 | 46 | import org.springframework.batch.item.ItemReader;
|
48 | 47 | import org.springframework.batch.item.ItemStream;
|
49 | 48 | import org.springframework.batch.item.ItemWriter;
|
50 |
| -import org.springframework.batch.item.function.FunctionItemProcessor; |
51 | 49 | import org.springframework.batch.repeat.CompletionPolicy;
|
52 | 50 | import org.springframework.batch.repeat.RepeatOperations;
|
53 | 51 | import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
|
@@ -78,8 +76,6 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
78 | 76 |
|
79 | 77 | private ItemProcessor<? super I, ? extends O> processor;
|
80 | 78 |
|
81 |
| - private Function<? super I, ? extends O> itemProcessorFunction; |
82 |
| - |
83 | 79 | private int chunkSize = 0;
|
84 | 80 |
|
85 | 81 | private RepeatOperations chunkOperations;
|
@@ -112,7 +108,6 @@ protected SimpleStepBuilder(SimpleStepBuilder<I, O> parent) {
|
112 | 108 | this.reader = parent.reader;
|
113 | 109 | this.writer = parent.writer;
|
114 | 110 | this.processor = parent.processor;
|
115 |
| - this.itemProcessorFunction = parent.itemProcessorFunction; |
116 | 111 | this.itemListeners = parent.itemListeners;
|
117 | 112 | this.readerTransactionalQueue = parent.readerTransactionalQueue;
|
118 | 113 | }
|
@@ -236,19 +231,6 @@ public SimpleStepBuilder<I, O> processor(ItemProcessor<? super I, ? extends O> p
|
236 | 231 | return this;
|
237 | 232 | }
|
238 | 233 |
|
239 |
| - /** |
240 |
| - * A {@link Function} to be delegated to as an {@link ItemProcessor}. If this is set, |
241 |
| - * it will take precedence over any {@code ItemProcessor} configured via |
242 |
| - * {@link #processor(ItemProcessor)}. |
243 |
| - * |
244 |
| - * @param function the function to delegate item processing to |
245 |
| - * @return this for fluent chaining |
246 |
| - */ |
247 |
| - public SimpleStepBuilder<I, O> processor(Function<? super I, ? extends O> function) { |
248 |
| - this.itemProcessorFunction = function; |
249 |
| - return this; |
250 |
| - } |
251 |
| - |
252 | 234 | /**
|
253 | 235 | * Sets a flag to say that the reader is transactional (usually a queue), which is to say that failed items might be
|
254 | 236 | * rolled back and re-presented in a subsequent transaction. Default is false, meaning that the items are read
|
@@ -359,10 +341,6 @@ protected ItemWriter<? super O> getWriter() {
|
359 | 341 | }
|
360 | 342 |
|
361 | 343 | protected ItemProcessor<? super I, ? extends O> getProcessor() {
|
362 |
| - if(this.itemProcessorFunction != null) { |
363 |
| - this.processor = new FunctionItemProcessor<>(this.itemProcessorFunction); |
364 |
| - } |
365 |
| - |
366 | 344 | return processor;
|
367 | 345 | }
|
368 | 346 |
|
|
0 commit comments