From b341e18c594886e0f5ea1d556d7c00968c5beefa Mon Sep 17 00:00:00 2001 From: Jay Bryant Date: Thu, 14 Apr 2022 14:25:53 -0500 Subject: [PATCH] Editing pass Mostly proofreading but a bit more detail in a couple places. --- .../batch/core/annotation/AfterChunkError.java | 2 +- .../springframework/batch/core/annotation/AfterJob.java | 4 ++-- .../batch/core/annotation/AfterProcess.java | 8 +++++--- .../springframework/batch/core/annotation/AfterStep.java | 4 ++-- .../springframework/batch/core/annotation/AfterWrite.java | 6 ++++-- .../springframework/batch/core/annotation/BeforeJob.java | 4 ++-- .../springframework/batch/core/annotation/BeforeStep.java | 4 ++-- .../batch/core/annotation/BeforeWrite.java | 4 ++-- .../batch/core/annotation/OnProcessError.java | 4 ++-- .../batch/core/annotation/OnReadError.java | 4 ++-- .../batch/core/annotation/OnSkipInProcess.java | 2 +- .../batch/core/annotation/OnSkipInRead.java | 4 ++-- .../batch/core/annotation/OnWriteError.java | 8 +++++--- 13 files changed, 32 insertions(+), 26 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterChunkError.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterChunkError.java index e4262746b0..93aa243f06 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterChunkError.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterChunkError.java @@ -24,7 +24,7 @@ import java.lang.annotation.Target; /** - * Marks a method to be called after a has failed and been + * Marks a method to be called after a chunk has failed and been * marked for rollback.
*
* Expected signature: void afterFailedChunk(ChunkContext context) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterJob.java index e2aa3cdf05..b7a75c358f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterJob.java @@ -27,10 +27,10 @@ /** * Marks a method to be called after a {@link Job} has completed. Annotated - * methods will be called regardless of the status of the {@link JobExecution}.
+ * methods are called regardless of the status of the {@link JobExecution}.
*
* Expected signature: void afterJob({@link JobExecution} jobExecution) - * + * * @author Lucas Ward * @since 2.0 * @see JobExecutionListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterProcess.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterProcess.java index 107139653e..e4b1ad853f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterProcess.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterProcess.java @@ -26,11 +26,13 @@ /** * Marks a method to be called after an item is passed to an - * {@link ItemProcessor}
+ * {@link ItemProcessor}. {@code item} is the input item. + * {@code result} is the processed item. {@code result} can be null + * if the {@code item} is filtered.
*
* Expected signature: void afterProcess(T item, S result) - * - * @author Lucas Ward + * + * @author Lucas Ward, Jay Bryant * @since 2.0 * @see ItemProcessListener */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterStep.java index bdbb376ecc..510fde8ca1 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterStep.java @@ -28,11 +28,11 @@ /** * Marks a method to be called after a {@link Step} has completed. Annotated - * methods will be called regardless of the status of the {@link StepExecution}.
+ * methods are called regardless of the status of the {@link StepExecution}.
*
* Expected signature: {@link ExitStatus} afterStep({@link StepExecution} * stepExecution); - * + * * @author Lucas Ward * @since 2.0 * @see StepExecutionListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterWrite.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterWrite.java index 516afb11a1..adc66f5f60 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterWrite.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/AfterWrite.java @@ -26,10 +26,12 @@ import org.springframework.batch.item.ItemWriter; /** - * Marks a method to be called after an item is passed to an {@link ItemWriter}
+ * Marks a method to be called after an item is passed to an {@link ItemWriter}. + * Note that this annotation takes a {@link List} because Spring Batch + * generally processes a group of items (for the sake of efficiency).
*
* Expected signature: void afterWrite({@link List}<? extends S> items) - * + * * @author Lucas Ward * @since 2.0 * @see ItemWriteListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeJob.java index ff2c077f42..76c18a034e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeJob.java @@ -29,11 +29,11 @@ /** * Marks a method to be called before a {@link Job} is executed, which comes - * after a {@link JobExecution} is created and persisted, but before the first + * after a {@link JobExecution} is created and persisted but before the first * {@link Step} is executed.
*
* Expected signature: void beforeJob({@link JobExecution} jobExecution) - * + * * @author Lucas Ward * @since 2.0 * @see JobExecutionListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeStep.java index d6daaf65ca..de04fb49c7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeStep.java @@ -27,11 +27,11 @@ /** * Marks a method to be called before a {@link Step} is executed, which comes - * after a {@link StepExecution} is created and persisted, but before the first + * after a {@link StepExecution} is created and persisted but before the first * item is read.
*
* Expected signature: void beforeStep({@link StepExecution} stepExecution) - * + * * @author Lucas Ward * @since 2.0 * @see StepExecutionListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeWrite.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeWrite.java index 9e558ad73d..409d6e5f75 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeWrite.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/BeforeWrite.java @@ -26,10 +26,10 @@ import org.springframework.batch.item.ItemWriter; /** - * Marks a method to be called before an item is passed to an {@link ItemWriter}
+ * Marks a method to be called before an item is passed to an {@link ItemWriter}.
*
* Expected signature: void beforeWrite({@link List}<? extends S> items) - * + * * @author Lucas Ward * @since 2.0 * @see ItemWriteListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnProcessError.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnProcessError.java index 828793ad75..8ef1cb2164 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnProcessError.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnProcessError.java @@ -26,10 +26,10 @@ /** * Marks a method to be called if an exception is thrown by an - * {@link ItemProcessor}
+ * {@link ItemProcessor}.
*
* Expected signature: void onProcessError(T item, {@link Exception} e) - * + * * @author Lucas Ward * @since 2.0 * @see ItemProcessListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnReadError.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnReadError.java index 971e4b7dae..b49e5b8619 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnReadError.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnReadError.java @@ -25,10 +25,10 @@ /** * Marks a method to be called if an exception is thrown by an - * {@link ItemReader}
+ * {@link ItemReader}.
*
* Expected signature: void onReadError({@link Exception} ex) - * + * * @author Lucas Ward * @since 2.0 * @see ItemReadListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInProcess.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInProcess.java index 71f49852f4..01556e5c13 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInProcess.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInProcess.java @@ -29,7 +29,7 @@ * thrown in the {@link ItemProcessor}.
*
* Expected signature: void onSkipInProcess(T item, {@link Throwable} t) - * + * * @author Lucas Ward * @since 2.0 * @see SkipListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInRead.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInRead.java index b733461fa0..d86342f05d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInRead.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnSkipInRead.java @@ -26,10 +26,10 @@ /** * Marks a method to be called when an item is skipped due to an exception - * thrown in the {@link ItemReader}
+ * thrown in the {@link ItemReader}.
*
* Expected signature: void onSkipInRead({@link Throwable} t) - * + * * @author Lucas Ward * @since 2.0 * @see SkipListener diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnWriteError.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnWriteError.java index c4c9f7d876..89250e7111 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnWriteError.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/OnWriteError.java @@ -27,11 +27,13 @@ /** * Marks a method to be called if an exception is thrown by an - * {@link ItemWriter}
+ * {@link ItemWriter}. Note that this annotation takes a {@link List} + * because Spring Batch generally processes a group of items + * (for the sake of efficiency).
*
* Expected signature: void onWriteError({@link Exception} exception, * {@link List}<? extends S> items) - * + * * @author Lucas Ward * @since 2.0 * @see ItemWriteListener @@ -40,4 +42,4 @@ @Target({ElementType.METHOD}) public @interface OnWriteError { -} \ No newline at end of file +}