diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java index c286795a71..c548a1d854 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java @@ -17,8 +17,8 @@ package org.springframework.batch.core; /** - * Enumeration representing the status of an Execution. - * + * Enumeration representing the status of an execution. + * * @author Lucas Ward * @author Dave Syer * @author Michael Minella @@ -28,14 +28,14 @@ public enum BatchStatus { /** * The order of the status values is significant because it can be used to - * aggregate a set of status values - the result should be the maximum - * value. Since COMPLETED is first in the order, only if all elements of an - * execution are COMPLETED will the aggregate status be COMPLETED. A running - * execution is expected to move from STARTING to STARTED to COMPLETED + * aggregate a set of status values. The result should be the maximum + * value. Since {@code COMPLETED} is first in the order, only if all elements of an + * execution are {@code COMPLETED} can the aggregate status be COMPLETED. A running + * execution is expected to move from {@code STARTING} to {@code STARTED} to {@code COMPLETED} * (through the order defined by {@link #upgradeTo(BatchStatus)}). Higher - * values than STARTED signify more serious failure. ABANDONED is used for - * steps that have finished processing, but were not successful, and where - * they should be skipped on a restart (so FAILED is the wrong status). + * values than {@code STARTED} signify more serious failures. {@code ABANDONED} is used for + * steps that have finished processing but were not successful and where + * they should be skipped on a restart (so {@code FAILED} is the wrong status). */ /** @@ -72,7 +72,7 @@ public enum BatchStatus { UNKNOWN; /** - * Convenience method to return the higher value status of the statuses pass in to the method. + * Convenience method to return the higher value status of the statuses passed to the method. * * @param status1 The first status to check. * @param status2 The second status to check. @@ -83,8 +83,8 @@ public static BatchStatus max(BatchStatus status1, BatchStatus status2) { } /** - * Convenience method to decide if a status indicates work is in progress. - * + * Convenience method to decide if a status indicates that work is in progress. + * * @return true if the status is STARTING, STARTED */ public boolean isRunning() { @@ -94,8 +94,8 @@ public boolean isRunning() { /** * Convenience method to decide if a status indicates execution was * unsuccessful. - * - * @return true if the status is FAILED or greater + * + * @return {@code true} if the status is {@code FAILED} or greater. */ public boolean isUnsuccessful() { return this == FAILED || this.isGreaterThan(FAILED); @@ -104,13 +104,13 @@ public boolean isUnsuccessful() { /** * Method used to move status values through their logical progression, and * override less severe failures with more severe ones. This value is - * compared with the parameter and the one that has higher priority is - * returned. If both are STARTED or less than the value returned is the - * largest in the sequence STARTING, STARTED, COMPLETED. Otherwise the value + * compared with the parameter, and the one that has higher priority is + * returned. If both are {@code STARTED} or less than the value returned is the + * largest in the sequence {@code STARTING}, {@code STARTED}, {@code COMPLETED}. Otherwise, the value * returned is the maximum of the two. - * - * @param other another status to compare to - * @return either this or the other status depending on their priority + * + * @param other Another status to which to compare. + * @return either this or the other status, depending on their priority. */ public BatchStatus upgradeTo(BatchStatus other) { if (isGreaterThan(STARTED) || other.isGreaterThan(STARTED)) { @@ -124,36 +124,36 @@ public BatchStatus upgradeTo(BatchStatus other) { } /** - * @param other a status value to compare - * @return true if this is greater than other + * @param other A status value to which to compare. + * @return {@code true} if this is greater than {@code other}. */ public boolean isGreaterThan(BatchStatus other) { return this.compareTo(other) > 0; } /** - * @param other a status value to compare - * @return true if this is less than other + * @param other A status value to which to compare. + * @return {@code true} if this is less than {@code other}. */ public boolean isLessThan(BatchStatus other) { return this.compareTo(other) < 0; } /** - * @param other a status value to compare - * @return true if this is less than other + * @param other A status value to which to compare. + * @return {@code true} if this is less than {@code other}. */ public boolean isLessThanOrEqualTo(BatchStatus other) { return this.compareTo(other) <= 0; } /** - * Find a BatchStatus that matches the beginning of the given value. If no - * match is found, return COMPLETED as the default because has is low + * Find a {@code BatchStatus} that matches the beginning of the given value. If no + * match is found, return {@code COMPLETED} as the default because it has low * precedence. - * - * @param value a string representing a status - * @return a BatchStatus + * + * @param value A string representing a status. + * @return a {BatchStatus} object. */ public static BatchStatus match(String value) { for (BatchStatus status : values()) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java index d012826463..2cd2539cb4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java @@ -18,8 +18,8 @@ import org.springframework.batch.core.scope.context.ChunkContext; /** - * Listener interface for the lifecycle of a chunk. A chunk - * can be thought of as a collection of items that will be + * Listener interface for the lifecycle of a chunk. A chunk + * can be thought of as a collection of items that are * committed together. * * @author Lucas Ward @@ -52,11 +52,11 @@ default void afterChunk(ChunkContext context) { /** * Callback after a chunk has been marked for rollback. It is invoked - * after transaction rollback. While the rollback will have occurred, - * transactional resources might still be active and accessible. Due to - * this, data access code within this callback will still "participate" in + * after transaction rollback. While the rollback will have occurred, + * transactional resources might still be active and accessible. Due to + * this, data access code within this callback still "participates" in * the original transaction unless it declares that it runs in its own - * transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any + * transaction. As a result, you should use {@code PROPAGATION_REQUIRES_NEW} for any * transactional operation that is called from here. * * @param context the chunk context containing the exception that caused diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java index d080fe6301..7f589b130e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java @@ -26,8 +26,8 @@ /** * Default implementation of the {@link JobKeyGenerator} interface. - * This implementation provides a single hash value based on the JobParameters - * passed in. Only identifying parameters (per {@link JobParameter#isIdentifying()}) + * This implementation provides a single hash value based on the {@code JobParameters} object + * passed in. Only identifying parameters (as per {@link JobParameter#isIdentifying()}) * are used in the calculation of the key. * * @author Michael Minella diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java index 1655b3370c..a2efa82000 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java @@ -22,9 +22,9 @@ /** * Batch Domain Entity class. Any class that should be uniquely identifiable - * from another should subclass from Entity. More information on this pattern - * and the difference between Entities and Value Objects can be found in Domain - * Driven Design by Eric Evans. + * from another should subclass from Entity. See Domain + * Driven Design, by Eric Evans, for more information on this pattern + * and the difference between Entities and Value Objects. * * @author Lucas Ward * @author Dave Syer @@ -75,22 +75,22 @@ public void setId(Long id) { } /** - * @return the version + * @return the version. */ public Integer getVersion() { return version; } /** - * Public setter for the version needed only by repository methods. - * @param version the version to set + * Public setter for the version. Needed only by repository methods. + * @param version The version to set. */ public void setVersion(Integer version) { this.version = version; } /** - * Increment the version number + * Increment the version number. */ public void incrementVersion() { if (version == null) { @@ -100,14 +100,18 @@ public void incrementVersion() { } } + /** + * Creates a string representation of the {@code Entity}, + * including the {@code id}, {@code version}, and class name. + */ @Override public String toString() { return String.format("%s: id=%d, version=%d", ClassUtils.getShortName(getClass()), id, version); } /** - * Attempt to establish identity based on id if both exist. If either id - * does not exist use Object.equals(). + * Attempt to establish identity based on {@code id} if both exist. If either {@code id} + * does not exist, use {@code Object.equals()}. * * @see java.lang.Object#equals(java.lang.Object) */ @@ -130,13 +134,14 @@ public boolean equals(Object other) { } /** - * Use ID if it exists to establish hash code, otherwise fall back to - * Object.hashCode(). Based on the same information as equals, so if that - * changes, this will. N.B. this follows the contract of Object.hashCode(), + * Use {@code id}, if it exists, to establish a hash code. Otherwise fall back to + * {@code Object.hashCode()}. It is based on the + * same information as {@code equals}, so, if that + * changes, this will. Note that this follows the contract of {@code Object.hashCode()} * but will cause problems for anyone adding an unsaved {@link Entity} to a - * Set because Set.contains() will almost certainly return false for the + * {@code Set} because {@code Set.contains()} almost certainly returns false for the * {@link Entity} after it is saved. Spring Batch does not store any of its - * entities in Sets as a matter of course, so internally this is consistent. + * entities in sets as a matter of course, so this is internally consistent. * Clients should not be exposed to unsaved entities. * * @see java.lang.Object#hashCode() diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java index e0bbee1ccf..6812cee2e4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java @@ -25,7 +25,7 @@ * Value object used to carry information about the status of a * job or step execution. * - * ExitStatus is immutable and therefore thread-safe. + * {@code ExitStatus} is immutable and, therefore, thread-safe. * * @author Dave Syer * @@ -34,8 +34,8 @@ public class ExitStatus implements Serializable, Comparable { /** - * Convenient constant value representing unknown state - assumed not - * continuable. + * Convenient constant value representing unknown state - assumed to not + * be continuable. */ public static final ExitStatus UNKNOWN = new ExitStatus("UNKNOWN"); @@ -54,8 +54,8 @@ public class ExitStatus implements Serializable, Comparable { public static final ExitStatus COMPLETED = new ExitStatus("COMPLETED"); /** - * Convenient constant value representing job that did no processing - * (e.g. because it was already complete). + * Convenient constant value representing a job that did no processing + * (for example, because it was already complete). */ public static final ExitStatus NOOP = new ExitStatus("NOOP"); @@ -115,8 +115,8 @@ public String getExitDescription() { /** * Create a new {@link ExitStatus} with a logical combination of the exit - * code, and a concatenation of the descriptions. If either value has a - * higher severity then its exit code will be used in the result. In the + * code and a concatenation of the description. If either value has a + * higher severity, its exit code is used in the result. In the * case of equal severity, the exit code is replaced if the new value is * alphabetically greater.
*
@@ -132,9 +132,9 @@ public String getExitDescription() { * * Others have severity 7, so custom exit codes always win.
* - * If the input is null just return this. + * If the input is {@code null} just return this. * - * @param status an {@link ExitStatus} to combine with this one. + * @param status An {@link ExitStatus} object to combine with this one. * @return a new {@link ExitStatus} combining the current value and the * argument provided. */ @@ -150,8 +150,9 @@ public ExitStatus and(ExitStatus status) { } /** - * @param status an {@link ExitStatus} to compare - * @return greater than zero, 0, less than zero according to the severity and exit code + * @param status An {@link ExitStatus} to compare + * @return greater than zero, 0, or less than zero, + * according to the severity and exit code. * @see java.lang.Comparable */ @Override @@ -166,8 +167,10 @@ public int compareTo(ExitStatus status) { } /** - * @param status - * @return + * Determines severity (an int between 1 and 7, inclusive) + * based on an {@code ExitStatus} object. + * @param status The {@code ExitStatus} object from which to determine the severity. + * @return the severity number. */ private int severity(ExitStatus status) { if (status.exitCode.startsWith(EXECUTING.exitCode)) { @@ -202,7 +205,7 @@ public String toString() { } /** - * Compare the fields one by one. + * Compare the fields, one by one. * * @see java.lang.Object#equals(java.lang.Object) */ @@ -226,9 +229,9 @@ public int hashCode() { /** * Add an exit code to an existing {@link ExitStatus}. If there is already a - * code present tit will be replaced. + * code present, it will be replaced. * - * @param code the code to add + * @param code The code to add. * @return a new {@link ExitStatus} with the same properties but a new exit * code. */ @@ -239,7 +242,7 @@ public ExitStatus replaceExitCode(String code) { /** * Check if this status represents a running process. * - * @return true if the exit code is "EXECUTING" or "UNKNOWN" + * @return {@code true} if the exit code is {@code EXECUTING} or {@code UNKNOWN}. */ public boolean isRunning() { return "EXECUTING".equals(this.exitCode) || "UNKNOWN".equals(this.exitCode); @@ -247,12 +250,12 @@ public boolean isRunning() { /** * Add an exit description to an existing {@link ExitStatus}. If there is - * already a description present the two will be concatenated with a + * already a description present, the two are concatenated with a * semicolon. * - * @param description the description to add + * @param description The description to add. * @return a new {@link ExitStatus} with the same properties but a new exit - * description + * description. */ public ExitStatus addExitDescription(String description) { StringBuilder buffer = new StringBuilder(); @@ -271,10 +274,10 @@ public ExitStatus addExitDescription(String description) { /** * Extract the stack trace from the throwable provided and append it to - * the exist description. + * the existing description. * - * @param throwable {@link Throwable} instance containing the stack trace. - * @return a new ExitStatus with the stack trace appended + * @param throwable A {@link Throwable} instance containing the stack trace. + * @return a new ExitStatus with the stack trace appended. */ public ExitStatus addExitDescription(Throwable throwable) { StringWriter writer = new StringWriter(); @@ -284,8 +287,8 @@ public ExitStatus addExitDescription(Throwable throwable) { } /** - * @param status the exit code to be evaluated - * @return true if the value matches a known exit code + * @param status The {@code ExitStatus} object containing the exit code to be evaluated. + * @return {@code true} if the value matches a known exit code. */ public static boolean isNonDefaultExitStatus(ExitStatus status) { return status == null || status.getExitCode() == null || diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java index 4f44d81665..cc634679b9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java @@ -19,11 +19,11 @@ import org.springframework.lang.Nullable; /** - * Listener interface for the processing of an item. Implementations - * of this interface will be notified before and after an item is + * Listener interface for the processing of an item. Implementations + * of this interface are notified before and after an item is * passed to the {@link ItemProcessor} and in the event of any * exceptions thrown by the processor. - * + * * @author Dave Syer * @author Mahmoud Ben Hassine * @@ -32,26 +32,26 @@ public interface ItemProcessListener extends StepListener { /** * Called before {@link ItemProcessor#process(Object)}. - * + * * @param item to be processed. */ default void beforeProcess(T item) { } - + /** * Called after {@link ItemProcessor#process(Object)} returns. If the - * processor returns {@code null}, this method will still be called, with - * a {code null} result, allowing for notification of 'filtered' items. - * + * processor returns {@code null}, this method is still called, with + * a {@code null} result, allowing for notification of "filtered" items. + * * @param item to be processed * @param result of processing */ default void afterProcess(T item, @Nullable S result) { } - + /** * Called if an exception was thrown from {@link ItemProcessor#process(Object)}. - * + * * @param item attempted to be processed * @param e - exception thrown during processing. */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java index a419d55485..0ac051b130 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java @@ -19,7 +19,7 @@ /** * Listener interface around the reading of an item. - * + * * @author Lucas Ward * @author Mahmoud Ben Hassine * @@ -31,20 +31,20 @@ public interface ItemReadListener extends StepListener { */ default void beforeRead() { } - + /** * Called after {@link ItemReader#read()}. - * This method is called only for actual items (ie it is not called when the - * reader returns null). - * + * This method is called only for actual items (that is, it is not called when the + * reader returns {@code null}). + * * @param item returned from read() */ default void afterRead(T item) { } - + /** * Called if an error occurs while trying to read. - * + * * @param ex thrown from {@link ItemReader} */ default void onReadError(Exception ex) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java index b69faa9f59..908428bc97 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java @@ -22,19 +22,19 @@ /** *

- * Listener interface for the writing of items. Implementations - * of this interface will be notified before, after, and in case + * Listener interface for the writing of items. Implementations + * of this interface are notified before, after, and in case * of any exception thrown while writing a list of items. *

* *

* Note: This listener is designed to work around the - * lifecycle of an item. This means that each method should be - * called once within the lifecycle of an item and in fault - * tolerant scenarios, any transactional work that is done in - * one of these methods would be rolled back and not re-applied. + * lifecycle of an item. This means that each method should be + * called once within the lifecycle of an item and that, in fault-tolerant + * scenarios, any transactional work that is done in + * one of these methods is rolled back and not re-applied. * Because of this, it is recommended to not perform any logic - * using this listener that participates in a transaction. + * that participates in a transaction when using this listener. *

* * @author Lucas Ward @@ -52,9 +52,9 @@ default void beforeWrite(List items) { } /** - * Called after {@link ItemWriter#write(java.util.List)} This will be + * Called after {@link ItemWriter#write(java.util.List)}. This is * called before any transaction is committed, and before - * {@link ChunkListener#afterChunk(ChunkContext)} + * {@link ChunkListener#afterChunk(ChunkContext)}. * * @param items written items */ @@ -62,7 +62,7 @@ default void afterWrite(List items) { } /** - * Called if an error occurs while trying to write. Will be called inside a + * Called if an error occurs while trying to write. Called inside a * transaction, but the transaction will normally be rolled back. There is * no way to identify from this callback which of the items (if any) caused * the error. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java index 3f57f02136..7ca16e105a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java @@ -18,11 +18,11 @@ import org.springframework.lang.Nullable; /** - * Batch domain object representing a job. Job is an explicit abstraction - * representing the configuration of a job specified by a developer. It should - * be noted that restart policy is applied to the job as a whole and not to a + * Batch domain object representing a job. {@code Job} is an explicit abstraction + * representing the configuration of a job specified by a developer. + * Note that the restart policy is applied to the job as a whole and not to a * step. - * + * * @author Dave Syer * @author Mahmoud Ben Hassine */ @@ -32,26 +32,26 @@ public interface Job { /** * Flag to indicate if this job can be restarted, at least in principle. - * + * * @return true if this job can be restarted after a failure */ boolean isRestartable(); /** - * Run the {@link JobExecution} and update the meta information like status - * and statistics as necessary. This method should not throw any exceptions + * Run the {@link JobExecution} and update the meta information, such as status + * and statistics, as necessary. This method should not throw any exceptions * for failed execution. Clients should be careful to inspect the * {@link JobExecution} status to determine success or failure. - * + * * @param execution a {@link JobExecution} */ void execute(JobExecution execution); /** * If clients need to generate new parameters for the next execution in a - * sequence they can use this incrementer. The return value may be {@code null}, - * in the case that this job does not have a natural sequence. - * + * sequence, they can use this incrementer. The return value may be {@code null}, + * when this job does not have a natural sequence. + * * @return in incrementer to be used for creating new parameters */ @Nullable @@ -59,11 +59,11 @@ public interface Job { /** * A validator for the job parameters of a {@link JobExecution}. Clients of - * a Job may need to validate the parameters for a launch, before or during + * a {@code Job} may need to validate the parameters for a launch or before or during * the execution. - * + * * @return a validator that can be used to check parameter values (never - * {@code null}) + * {@code null}). */ JobParametersValidator getJobParametersValidator(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java index 76ab2916cf..3817a9f268 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java @@ -87,12 +87,12 @@ public JobExecution(JobExecution original) { } /** - * Because a JobExecution isn't valid unless the job is set, this + * Because a JobExecution is not valid unless the job is set, this * constructor is the only valid one from a modeling point of view. * - * @param job the job of which this execution is a part - * @param id {@link Long} that represents the id for the JobExecution. - * @param jobParameters {@link JobParameters} instance for this JobExecution. + * @param job The job of which this execution is a part. + * @param id A {@link Long} that represents the {@code id} for the {@code JobExecution}. + * @param jobParameters A {@link JobParameters} instance for this {@code JobExecution}. */ public JobExecution(JobInstance job, Long id, @Nullable JobParameters jobParameters) { super(id); @@ -104,16 +104,16 @@ public JobExecution(JobInstance job, Long id, @Nullable JobParameters jobParamet * Constructor for transient (unsaved) instances. * * @param job The enclosing {@link JobInstance}. - * @param jobParameters The {@link JobParameters} instance for this JobExecution. + * @param jobParameters The {@link JobParameters} instance for this {@code JobExecution}. */ public JobExecution(JobInstance job, JobParameters jobParameters) { this(job, null, jobParameters); } /** - * Constructor that accepts the job execution ID and {@link JobParameters}. + * Constructor that accepts the job execution {@code id} and {@link JobParameters}. * - * @param id The job execution ID. + * @param id The job execution {@code id}. * @param jobParameters The {@link JobParameters} for the {@link JobExecution}. */ public JobExecution(Long id, JobParameters jobParameters) { @@ -121,9 +121,9 @@ public JobExecution(Long id, JobParameters jobParameters) { } /** - * Constructor that accepts the job execution ID. + * Constructor that accepts the job execution {@code id}. * - * @param id The job execution ID. + * @param id The job execution {@code id}. */ public JobExecution(Long id) { this(null, id, null); @@ -185,30 +185,30 @@ public BatchStatus getStatus() { } /** - * Set the value of the status field. + * Set the value of the {@code status} field. * - * @param status the status to set + * @param status The status to set. */ public void setStatus(BatchStatus status) { this.status = status; } /** - * Upgrade the status field if the provided value is greater than the + * Upgrade the {@code status} field if the provided value is greater than the * existing one. Clients using this method to set the status can be sure - * that they don't overwrite a failed status with an successful one. + * to not overwrite a failed status with a successful one. * - * @param status the new status value + * @param status The new status value. */ public void upgradeStatus(BatchStatus status) { this.status = this.status.upgradeTo(status); } /** - * Convenience getter for for the id of the enclosing job. Useful for DAO + * Convenience getter for the {@code id} of the enclosing job. Useful for DAO * implementations. * - * @return the id of the enclosing job + * @return the @{code id} of the enclosing job. */ public Long getJobId() { if (jobInstance != null) { @@ -218,14 +218,14 @@ public Long getJobId() { } /** - * @param exitStatus {@link ExitStatus} instance to be used for job execution. + * @param exitStatus The {@link ExitStatus} instance to be used for job execution. */ public void setExitStatus(ExitStatus exitStatus) { this.exitStatus = exitStatus; } /** - * @return the exitCode + * @return the {@code exitStatus}. */ public ExitStatus getExitStatus() { return exitStatus; @@ -241,7 +241,7 @@ public JobInstance getJobInstance() { /** * Accessor for the step executions. * - * @return the step executions that were registered + * @return the step executions that were registered. */ public Collection getStepExecutions() { return Collections.unmodifiableList(new ArrayList<>(stepExecutions)); @@ -249,8 +249,8 @@ public Collection getStepExecutions() { /** * Register a step execution with the current job execution. - * @param stepName the name of the step the new execution is associated with - * @return {@link StepExecution} an empty {@code StepExecution} associated with this + * @param stepName the name of the step the new execution is associated with. + * @return an empty {@code StepExecution} associated with this * {@code JobExecution}. */ public StepExecution createStepExecution(String stepName) { @@ -260,11 +260,10 @@ public StepExecution createStepExecution(String stepName) { } /** - * Test if this {@link JobExecution} indicates that it is running. It should - * be noted that this does not necessarily mean that it has been persisted - * as such yet. + * Test if this {@link JobExecution} indicates that it is running. + * Note that this does not necessarily mean that it has been persisted. * - * @return true if the end time is null and the start time is not null + * @return {@code true} if the end time is null and the start time is not null. */ public boolean isRunning() { return startTime != null && endTime == null; @@ -273,16 +272,16 @@ public boolean isRunning() { /** * Test if this {@link JobExecution} indicates that it has been signalled to * stop. - * @return true if the status is {@link BatchStatus#STOPPING} + * @return {@code true} if the status is {@link BatchStatus#STOPPING}. */ public boolean isStopping() { return status == BatchStatus.STOPPING; } /** - * Sets the {@link ExecutionContext} for this execution + * Sets the {@link ExecutionContext} for this execution. * - * @param executionContext the context + * @param executionContext The context. */ public void setExecutionContext(ExecutionContext executionContext) { this.executionContext = executionContext; @@ -292,7 +291,7 @@ public void setExecutionContext(ExecutionContext executionContext) { * Returns the {@link ExecutionContext} for this execution. The content is * expected to be persisted after each step completion (successful or not). * - * @return the context + * @return The {@code ExecutionContext}. */ public ExecutionContext getExecutionContext() { return executionContext; @@ -306,35 +305,37 @@ public Date getCreateTime() { } /** - * @param createTime creation time of this execution. + * @param createTime The creation time of this execution. */ public void setCreateTime(Date createTime) { this.createTime = createTime; } /** - * Package private method for re-constituting the step executions from + * Package-private method for re-constituting the step executions from * existing instances. - * @param stepExecution execution to be added + * @param The {@code stepExecution} execution to be added. */ void addStepExecution(StepExecution stepExecution) { stepExecutions.add(stepExecution); } /** - * Get the date representing the last time this JobExecution was updated in - * the JobRepository. + * Get the date representing the last time this {@code JobExecution} was updated in + * the {@link JobRepository}. * - * @return Date representing the last time this JobExecution was updated. + * @return a {@code Date} object representing the last time this + * {@code JobExecution} was updated. */ public Date getLastUpdated() { return lastUpdated; } /** - * Set the last time this JobExecution was updated. + * Set the last time this {@code JobExecution} was updated. * - * @param lastUpdated {@link Date} instance to mark job execution's lastUpdated attribute. + * @param lastUpdated The {@link Date} instance to which to set + * the job execution's {@code lastUpdated} attribute. */ public void setLastUpdated(Date lastUpdated) { this.lastUpdated = lastUpdated; @@ -342,7 +343,7 @@ public void setLastUpdated(Date lastUpdated) { /** * Retrieve a list of exceptions. - * @return The {@link List} of {@link Throwable} objects. + * @return the {@link List} of {@link Throwable} objects. */ public List getFailureExceptions() { return failureExceptions; @@ -351,18 +352,18 @@ public List getFailureExceptions() { /** * Add the provided throwable to the failure exception list. * - * @param t {@link Throwable} instance to be added failure exception list. + * @param t A {@link Throwable} instance to be added failure exception list. */ public synchronized void addFailureException(Throwable t) { this.failureExceptions.add(t); } /** - * Return all failure causing exceptions for this JobExecution, including + * Return all failure causing exceptions for this {@code JobExecution}, including * step executions. * - * @return List<Throwable> containing all exceptions causing failure for - * this JobExecution. + * @return a {@code List} containing all exceptions causing failure for + * this {@code JobExecution}. */ public synchronized List getAllFailureExceptions() { @@ -380,8 +381,8 @@ public synchronized List getAllFailureExceptions() { * * @param stream instance of {@link ObjectInputStream}. * - * @throws IOException thrown if error occurs during read. - * @throws ClassNotFoundException thrown if class is not found. + * @throws {@code IOException} if an error occurs during read. + * @throws {@code ClassNotFoundException} thrown if the class is not found. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); @@ -401,8 +402,8 @@ public String toString() { } /** - * Add some step executions. For internal use only. - * @param stepExecutions step executions to add to the current list + * Add some step executions. For internal use only. + * @param stepExecutions The step executions to add to the current list. */ public void addStepExecutions(List stepExecutions) { if (stepExecutions!=null) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java index 471d1500cc..008c17ef88 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java @@ -18,18 +18,18 @@ /** * Root of exception hierarchy for checked exceptions in job and step execution. * Clients of the {@link Job} should expect to have to catch and deal with these - * exceptions because they signal a user error, or an inconsistent state between + * exceptions because they signal a user error or an inconsistent state between * the user's instructions and the data. - * + * * @author Dave Syer - * + * */ @SuppressWarnings("serial") public class JobExecutionException extends Exception { /** * Construct a {@link JobExecutionException} with a generic message. - * @param msg the message + * @param msg The message. */ public JobExecutionException(String msg) { super(msg); @@ -38,9 +38,9 @@ public JobExecutionException(String msg) { /** * Construct a {@link JobExecutionException} with a generic message and a * cause. - * - * @param msg the message - * @param cause the cause of the exception + * + * @param msg The message. + * @param cause The cause of the exception. */ public JobExecutionException(String msg, Throwable cause) { super(msg, cause); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java index 6e088e20ff..319d879767 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java @@ -18,7 +18,7 @@ /** * Provide callbacks at specific points in the lifecycle of a {@link Job}. * Implementations can be stateful if they are careful to either ensure thread - * safety, or to use one instance of a listener per job, assuming that job + * safety or to use one instance of a listener per job, assuming that job * instances themselves are not used by more than one thread. * * @author Dave Syer @@ -35,9 +35,9 @@ default void beforeJob(JobExecution jobExecution) { } /** - * Callback after completion of a job. Called after both both successful and + * Callback after completion of a job. Called after both successful and * failed executions. To perform logic on a particular status, use - * "if (jobExecution.getStatus() == BatchStatus.X)". + * {@code if (jobExecution.getStatus() == BatchStatus.X)}. * * @param jobExecution the current {@link JobExecution} */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java index 0b084fc53e..d6597de631 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java @@ -20,12 +20,12 @@ /** * Batch domain object representing a uniquely identifiable job run. - * JobInstance can be restarted multiple times in case of execution failure and - * it's lifecycle ends with first successful execution. + * {@code JobInstance} can be restarted multiple times in case of execution failure, and + * its lifecycle ends with first successful execution. * - * Trying to execute an existing JobInstance that has already completed - * successfully will result in error. Error will be raised also for an attempt - * to restart a failed JobInstance if the Job is not restartable. + * Trying to execute an existing {@code JobInstance} that has already completed + * successfully results in an error. An error is also raised for an attempt + * to restart a failed {@code JobInstance} if the {@code Job} is not restartable. * * @see Job * @see JobParameters @@ -56,12 +56,15 @@ public JobInstance(Long id, String jobName) { } /** - * @return the job name. (Equivalent to getJob().getName()) + * @return the job name. (Equivalent to {@code getJob().getName()}). */ public String getJobName() { return jobName; } + /** + * Adds the job name to the string representation of the super class ({@link Entity}). + */ @Override public String toString() { return super.toString() + ", Job=[" + jobName + "]"; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java index 5d9f506a84..94baeece4c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java @@ -20,17 +20,17 @@ /** * Exception to indicate the job has been interrupted. The exception state * indicated is not normally recoverable by batch application clients, but - * internally it is useful to force a check. The exception will often be wrapped - * in a runtime exception (usually {@link UnexpectedJobExecutionException} before + * it is used internally to force a check. The exception is often wrapped + * in a runtime exception (usually {@link UnexpectedJobExecutionException}) before * reaching the client. - * + * * @author Lucas Ward * @author Dave Syer - * + * */ @SuppressWarnings("serial") public class JobInterruptedException extends JobExecutionException { - + private BatchStatus status = BatchStatus.STOPPED; /** @@ -52,10 +52,10 @@ public JobInterruptedException(String msg, BatchStatus status) { super(msg); this.status = status; } - + /** * The desired status of the surrounding execution after the interruption. - * + * * @return the status of the interruption (default STOPPED) */ public BatchStatus getStatus() { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java index e6008b3b12..7fa3ebb884 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java @@ -17,7 +17,7 @@ /** * Strategy interface for the generation of the key used in identifying - * unique {@link JobInstance}. + * unique {@link JobInstance} objects. * * @author Michael Minella * @author Mahmoud Ben Hassine @@ -30,10 +30,10 @@ public interface JobKeyGenerator { /** * Method to generate the unique key used to identify a job instance. * - * @param source Source information used to generate the key (must not be {@code null}) + * @param source Source information used to generate the key (must not be {@code null}). * * @return a unique string identifying the job based on the information - * supplied + * supplied. */ String generateKey(T source); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java index b7e04112f9..8fc8b5e8e9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java @@ -24,7 +24,7 @@ /** * Domain representation of a parameter to a batch job. Only the following types - * can be parameters: String, Long, Date, and Double. The identifying flag is + * can be parameters: String, Long, Date, and Double. The identifying flag is * used to indicate if the parameter is to be used as part of the identification of * a job instance. * @@ -44,39 +44,39 @@ public class JobParameter implements Serializable { private final boolean identifying; /** - * Construct a new JobParameter as a String. + * Construct a new {@code JobParameter} from a {@code String}. * @param parameter {@link String} instance. Must not be {@code null}. - * @param identifying true if JobParameter should be identifying. + * @param identifying {@code true} if the {@code JobParameter} should be identifying. */ public JobParameter(@NonNull String parameter, boolean identifying) { this(parameter, identifying, ParameterType.STRING); } /** - * Construct a new JobParameter as a Long. + * Construct a new {@code JobParameter} from a {@code Long}. * * @param parameter {@link Long} instance. Must not be {@code null}. - * @param identifying true if JobParameter should be identifying. + * @param identifying {@code true} if the {@code JobParameter} should be identifying. */ public JobParameter(@NonNull Long parameter, boolean identifying) { this(parameter, identifying, ParameterType.LONG); } /** - * Construct a new JobParameter as a Date. + * Construct a new {@code JobParameter} from a {@code Date}. * * @param parameter {@link Date} instance. Must not be {@code null}. - * @param identifying true if JobParameter should be identifying. + * @param identifying {@code true} if the {@code JobParameter} should be identifying. */ public JobParameter(@NonNull Date parameter, boolean identifying) { this(parameter, identifying, ParameterType.DATE); } /** - * Construct a new JobParameter as a Double. + * Construct a new {@code JobParameter} from a {@code Double}. * * @param parameter {@link Double} instance. Must not be {@code null}. - * @param identifying true if JobParameter should be identifying. + * @param identifying {@code true} if the {@code JobParameter} should be identifying. */ public JobParameter(@NonNull Double parameter, boolean identifying) { this(parameter, identifying, ParameterType.DOUBLE); @@ -90,57 +90,57 @@ private JobParameter(Object parameter, boolean identifying, ParameterType parame } /** - * Construct a new JobParameter as a String. + * Construct a new {@code JobParameter} from a {@code String}. * - * @param parameter {@link String} instance. + * @param parameter A {@link String} instance. */ public JobParameter(String parameter) { this(parameter, true); } /** - * Construct a new JobParameter as a Long. + * Construct a new {@code JobParameter} from a {@code Long}. * - * @param parameter {@link Long} instance. + * @param parameter A {@link Long} instance. */ public JobParameter(Long parameter) { this(parameter, true); } /** - * Construct a new JobParameter as a Date. + * Construct a new {@code JobParameter} as a {@code Date}. * - * @param parameter {@link Date} instance. + * @param parameter A {@link Date} instance. */ public JobParameter(Date parameter) { this(parameter, true); } /** - * Construct a new JobParameter as a Double. + * Construct a new {@code JobParameter} from a {@code Double}. * - * @param parameter {@link Double} instance. + * @param parameter A {@link Double} instance. */ public JobParameter(Double parameter) { this(parameter, true); } /** - * @return The identifying flag. It is set to true if the job parameter is identifying. + * @return The identifying flag. It is set to {@code true} if the job parameter is identifying. */ public boolean isIdentifying() { return identifying; } /** - * @return the value contained within this JobParameter. + * @return the value contained within this {@code JobParameter}. */ public Object getValue() { return parameter; } /** - * @return a ParameterType representing the type of this parameter. + * @return a {@code ParameterType} representing the type of this parameter. */ public ParameterType getType() { return parameterType; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java index d53a3483a6..45c15df446 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java @@ -28,15 +28,16 @@ /** * Value object representing runtime parameters to a batch job. Because the - * parameters have no individual meaning outside of the JobParameters they are + * parameters have no individual meaning outside + * of the {@code JobParameters} object they are * contained within, it is a value object rather than an entity. It is also * extremely important that a parameters object can be reliably compared to - * another for equality, in order to determine if one JobParameters object - * equals another. Furthermore, because these parameters will need to be + * another for equality, in order to determine if one {@code JobParameters} object + * equals another. Furthermore, because these parameters need to be * persisted, it is vital that the types added are restricted. - * - * This class is immutable and therefore thread-safe. - * + * + * This class is immutable and, therefore, thread-safe. + * * @author Lucas Ward * @author Michael Minella * @author Mahmoud Ben Hassine @@ -56,19 +57,21 @@ public JobParameters() { } /** - * Constructor that is initialized with the content of a {@link Map} that contains a string key and {@link JobParameter} value. + * Constructor that is initialized with the content of a {@link Map} + * that contains a {@code String} key and a {@link JobParameter} value. * - * @param parameters The {@link Map} that contains a string key and {@link JobParameter} value. + * @param parameters The {@link Map} that contains a {@code String} key + * and a {@link JobParameter} value. */ public JobParameters(Map parameters) { this.parameters = new LinkedHashMap<>(parameters); } /** - * Typesafe Getter for the Long represented by the provided key. - * - * @param key The key to get a value for - * @return The Long value or {@code null} if the key is absent + * Typesafe getter for the {@code Long} represented by the provided key. + * + * @param key The key for which to get a value. + * @return The {@code Long} value or {@code null} if the key is absent. */ @Nullable public Long getLong(String key){ @@ -80,13 +83,13 @@ public Long getLong(String key){ } /** - * Typesafe Getter for the Long represented by the provided key. If the - * key does not exist, the default value will be returned. + * Typesafe getter for the {@code Long} represented by the provided key. If the + * key does not exist, the default value is returned. * - * @param key to return the value for - * @param defaultValue to return if the value doesn't exist - * @return the parameter represented by the provided key, defaultValue - * otherwise. + * @param key The key for which to return the value. + * @param defaultValue The default value to return if the value does not exist. + * @return the parameter represented by the provided key or, if that is + * missing, the default value. */ @Nullable public Long getLong(String key, @Nullable Long defaultValue){ @@ -99,10 +102,10 @@ public Long getLong(String key, @Nullable Long defaultValue){ } /** - * Typesafe Getter for the String represented by the provided key. - * - * @param key The key to get a value for - * @return The String value or {@code null} if the key is absent + * Typesafe getter for the {@code String} represented by the provided key. + * + * @param key The key for which to get a value. + * @return The {@code String} value or {@code null} if the key is absent. */ @Nullable public String getString(String key){ @@ -111,13 +114,13 @@ public String getString(String key){ } /** - * Typesafe Getter for the String represented by the provided key. If the - * key does not exist, the default value will be returned. - * - * @param key to return the value for - * @param defaultValue to return if the value doesn't exist - * @return the parameter represented by the provided key, defaultValue - * otherwise. + * Typesafe getter for the {@code String} represented by the provided key. If the + * key does not exist, the default value is returned. + * + * @param key The key for which to return the value. + * @param defaultValue The defult value to return if the value does not exist. + * @return the parameter represented by the provided key or, if that is + * missing, the default value. */ @Nullable public String getString(String key, @Nullable String defaultValue){ @@ -130,10 +133,10 @@ public String getString(String key, @Nullable String defaultValue){ } /** - * Typesafe Getter for the Long represented by the provided key. - * - * @param key The key to get a value for - * @return The Double value or {@code null} if the key is absent + * Typesafe getter for the {@code Long} represented by the provided key. + * + * @param key The key for which to get a value. + * @return The {@code Double} value or {@code null} if the key is absent. */ @Nullable public Double getDouble(String key){ @@ -145,13 +148,13 @@ public Double getDouble(String key){ } /** - * Typesafe Getter for the Double represented by the provided key. If the - * key does not exist, the default value will be returned. + * Typesafe getter for the {@code Double} represented by the provided key. If the + * key does not exist, the default value is returned. * - * @param key to return the value for - * @param defaultValue to return if the value doesn't exist - * @return the parameter represented by the provided key, defaultValue - * otherwise. + * @param key The key for which to return the value. + * @param defaultValue The default value to return if the value does not exist. + * @return the parameter represented by the provided key or, if that is + * missing, the default value. */ @Nullable public Double getDouble(String key, @Nullable Double defaultValue){ @@ -164,11 +167,11 @@ public Double getDouble(String key, @Nullable Double defaultValue){ } /** - * Typesafe Getter for the Date represented by the provided key. - * - * @param key The key to get a value for - * @return The java.util.Date value or {@code null} if the key - * is absent + * Typesafe getter for the {@code Date} represented by the provided key. + * + * @param key The key for which to get a value. + * @return the {@code java.util.Date} value or {@code null} if the key + * is absent. */ @Nullable public Date getDate(String key){ @@ -176,13 +179,13 @@ public Date getDate(String key){ } /** - * Typesafe Getter for the Date represented by the provided key. If the - * key does not exist, the default value will be returned. - * - * @param key to return the value for - * @param defaultValue to return if the value doesn't exist - * @return the parameter represented by the provided key, defaultValue - * otherwise. + * Typesafe getter for the {@code Date} represented by the provided key. If the + * key does not exist, the default value is returned. + * + * @param key The key for which to return the value. + * @param defaultValue The default value to return if the value does not exist. + * @return the parameter represented by the provided key or, if that is + * missing, the default value. */ @Nullable public Date getDate(String key, @Nullable Date defaultValue){ @@ -195,8 +198,9 @@ public Date getDate(String key, @Nullable Date defaultValue){ } /** - * Get a map of all parameters, including string, long, and date. - * + * Get a map of all parameters, including {@code String}, + * {@code Long}, and {@code Date} types. + * * @return an unmodifiable map containing all parameters. */ public Map getParameters(){ @@ -204,7 +208,7 @@ public Map getParameters(){ } /** - * @return true if the parameters is empty, false otherwise. + * @return {@code true} if the parameters object is empty or {@code false} otherwise. */ public boolean isEmpty(){ return parameters.isEmpty(); @@ -235,7 +239,7 @@ public String toString() { } /** - * @return The {@link Properties} that contain the key and values for the {@link JobParameter}s. + * @return The {@link Properties} that contain the key and values for the {@link JobParameter} objects. */ public Properties toProperties() { Properties props = new Properties(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java index 7a192be103..1620b48b5e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java @@ -28,14 +28,14 @@ /** * Helper class for creating {@link JobParameters}. Useful because all - * {@link JobParameter} objects are immutable, and must be instantiated separately + * {@link JobParameter} objects are immutable and must be instantiated separately * to ensure type safety. Once created, it can be used in the - * same was a java.lang.StringBuilder (except, order is irrelevant), by adding - * various parameter types and creating a valid {@link JobParameters} once + * same was a {@code java.lang.StringBuilder} (except that order is irrelevant), by adding + * various parameter types and creating a valid {@link JobParameters} object once * finished.
*
- * Using the identifying flag indicates if the parameter will be used - * in the identification of a JobInstance. That flag defaults to true. + * Using the {@code identifying} flag indicates if the parameter should be used + * in the identification of a {@code JobInstance} object. That flag defaults to {@code true}. * * @author Lucas Ward * @author Michael Minella @@ -59,7 +59,7 @@ public JobParametersBuilder() { } /** - * @param jobExplorer {@link JobExplorer} used for looking up previous job parameter information + * @param jobExplorer {@link JobExplorer} used for looking up previous job parameter information. */ public JobParametersBuilder(JobExplorer jobExplorer) { this.jobExplorer = jobExplorer; @@ -75,10 +75,10 @@ public JobParametersBuilder(JobParameters jobParameters) { } /** - * Constructor to add conversion capabilities to support JSR-352. Per the spec, it is expected that all - * keys and values in the provided {@link Properties} instance are Strings + * Constructor to add conversion capabilities to support JSR-352. Per the spec, it is expected that all + * keys and values in the provided {@link Properties} instance are {@code String} objects. * - * @param properties the job parameters to be used + * @param properties the job parameters to be used. */ public JobParametersBuilder(Properties properties) { this.parameterMap = new LinkedHashMap<>(); @@ -93,7 +93,7 @@ public JobParametersBuilder(Properties properties) { /** * Copy constructor. Initializes the builder with the supplied parameters. * @param jobParameters {@link JobParameters} instance used to initialize the builder. - * @param jobExplorer {@link JobExplorer} used for looking up previous job parameter information + * @param jobExplorer {@link JobExplorer} used for looking up previous job parameter information. */ public JobParametersBuilder(JobParameters jobParameters, JobExplorer jobExplorer) { this.jobExplorer = jobExplorer; @@ -103,8 +103,8 @@ public JobParametersBuilder(JobParameters jobParameters, JobExplorer jobExplorer /** * Add a new identifying String parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. * @return a reference to this object. */ public JobParametersBuilder addString(String key, @NonNull String parameter) { @@ -115,9 +115,9 @@ public JobParametersBuilder addString(String key, @NonNull String parameter) { /** * Add a new String parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. - * @param identifying - indicates if the parameter is used as part of identifying a job instance + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. + * @param identifying The indicates if the parameter is used as part of identifying a job instance. * @return a reference to this object. */ public JobParametersBuilder addString(String key, @NonNull String parameter, boolean identifying) { @@ -128,8 +128,8 @@ public JobParametersBuilder addString(String key, @NonNull String parameter, boo /** * Add a new identifying {@link Date} parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. * @return a reference to this object. */ public JobParametersBuilder addDate(String key, @NonNull Date parameter) { @@ -140,9 +140,9 @@ public JobParametersBuilder addDate(String key, @NonNull Date parameter) { /** * Add a new {@link Date} parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. - * @param identifying - indicates if the parameter is used as part of identifying a job instance + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. + * @param identifying Indicates if the parameter is used as part of identifying a job instance * @return a reference to this object. */ public JobParametersBuilder addDate(String key, @NonNull Date parameter, boolean identifying) { @@ -153,8 +153,8 @@ public JobParametersBuilder addDate(String key, @NonNull Date parameter, boolean /** * Add a new identifying Long parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. * @return a reference to this object. */ public JobParametersBuilder addLong(String key, @NonNull Long parameter) { @@ -163,11 +163,11 @@ public JobParametersBuilder addLong(String key, @NonNull Long parameter) { } /** - * Add a new Long parameter for the given key. + * Add a new {@code Long} parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. - * @param identifying - indicates if the parameter is used as part of identifying a job instance + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. + * @param identifying Indicates if the parameter is used as part of identifying a job instance. * @return a reference to this object. */ public JobParametersBuilder addLong(String key, @NonNull Long parameter, boolean identifying) { @@ -176,10 +176,10 @@ public JobParametersBuilder addLong(String key, @NonNull Long parameter, boolean } /** - * Add a new identifying Double parameter for the given key. + * Add a new identifying {@code Double} parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. * @return a reference to this object. */ public JobParametersBuilder addDouble(String key, @NonNull Double parameter) { @@ -188,11 +188,11 @@ public JobParametersBuilder addDouble(String key, @NonNull Double parameter) { } /** - * Add a new Double parameter for the given key. + * Add a new {@code Double} parameter for the given key. * - * @param key - parameter accessor. - * @param parameter - runtime parameter. Must not be {@code null}. - * @param identifying - indicates if the parameter is used as part of identifying a job instance + * @param key The parameter accessor. + * @param parameter The runtime parameter. Must not be {@code null}. + * @param identifying Indicates if the parameter is used as part of identifying a job instance. * @return a reference to this object. */ public JobParametersBuilder addDouble(String key, @NonNull Double parameter, boolean identifying) { @@ -202,7 +202,7 @@ public JobParametersBuilder addDouble(String key, @NonNull Double parameter, boo /** * Conversion method that takes the current state of this builder and - * returns it as a JobParameters object. + * returns it as a {@code JobParameters} object. * * @return a valid {@link JobParameters} object. */ @@ -213,8 +213,8 @@ public JobParameters toJobParameters() { /** * Add a new {@link JobParameter} for the given key. * - * @param key - parameter accessor - * @param jobParameter - runtime parameter + * @param key The parameter accessor. + * @param jobParameter The runtime parameter. * @return a reference to this object. */ public JobParametersBuilder addParameter(String key, JobParameter jobParameter) { @@ -225,7 +225,7 @@ public JobParametersBuilder addParameter(String key, JobParameter jobParameter) /** * Copy job parameters into the current state. - * @param jobParameters parameters to copy in + * @param jobParameters The parameters to copy in. * @return a reference to this object. */ public JobParametersBuilder addJobParameters(JobParameters jobParameters) { @@ -237,14 +237,14 @@ public JobParametersBuilder addJobParameters(JobParameters jobParameters) { } /** - * Initializes the {@link JobParameters} based on the state of the {@link Job}. This + * Initializes the {@link JobParameters} based on the state of the {@link Job}. This * should be called after all parameters have been entered into the builder. - * All parameters already set on this builder instance will be appended to - * those retrieved from the job incrementer, overriding any with the same key (Same - * behaviour as {@link org.springframework.batch.core.launch.support.CommandLineJobRunner} - * with "-next" option and {@link org.springframework.batch.core.launch.JobOperator#startNextInstance(String)}) + * All parameters already set on this builder instance are appended to + * those retrieved from the job incrementer, overriding any with the same key (this is the same + * behavior as {@link org.springframework.batch.core.launch.support.CommandLineJobRunner} + * with the {@code -next} option and {@link org.springframework.batch.core.launch.JobOperator#startNextInstance(String)}). * - * @param job the job for which the {@link JobParameters} are being constructed. + * @param job The job for which the {@link JobParameters} are being constructed. * @return a reference to this object. * * @since 4.0 diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersIncrementer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersIncrementer.java index e07ee14ac0..f8f685e89c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersIncrementer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersIncrementer.java @@ -18,8 +18,8 @@ import org.springframework.lang.Nullable; /** - * Interface for obtaining the next {@link JobParameters} in a sequence. - * + * Interface for obtaining the next {@link JobParameters} object in a sequence. + * * @author Dave Syer * @author Lucas Ward * @author Mahmoud Ben Hassine @@ -28,10 +28,10 @@ public interface JobParametersIncrementer { /** - * Increment the provided parameters. If the input is empty, then this + * Increments the provided parameters. If the input is empty, this method * should return a bootstrap or initial value to be used on the first * instance of a job. - * + * * @param parameters the last value used * @return the next value to use (never {@code null}) */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersValidator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersValidator.java index 15eecabadf..f8c59f730d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersValidator.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersValidator.java @@ -20,7 +20,7 @@ /** * Strategy interface for a {@link Job} to use in validating its parameters for * an execution. - * + * * @author Dave Syer * @author Mahmoud Ben Hassine * @@ -28,9 +28,9 @@ public interface JobParametersValidator { /** - * Check the parameters meet whatever requirements are appropriate, and + * Check that the parameters meet whatever requirements are appropriate, and * throw an exception if not. - * + * * @param parameters some {@link JobParameters} (can be {@code null}) * @throws JobParametersInvalidException if the parameters are invalid */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/SkipListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/SkipListener.java index e76315df01..1f6f89f7c1 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/SkipListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/SkipListener.java @@ -16,26 +16,26 @@ package org.springframework.batch.core; /** - * Interface for listener to skipped items. Callbacks will be called by + * Interface for listener to skipped items. Callbacks are called by * {@link Step} implementations at the appropriate time in the step lifecycle. - * Implementers of this interface should not assume that any method will be - * called immediately after an error has been encountered. Because there - * may be errors later on in processing the chunk, this listener will not be + * Implementers of this interface should not assume that any method is + * called immediately after an error has been encountered. Because there + * may be errors later on in processing the chunk, this listener is not * called until just before committing. - * + * * @author Dave Syer * @author Robert Kasanicky * @author Mahmoud Ben Hassine - * + * */ public interface SkipListener extends StepListener { /** - * Callback for a failure on read that is legal, so is not going to be - * re-thrown. In case transaction is rolled back and items are re-read, this - * callback will occur repeatedly for the same cause. This will only happen + * Callback for a failure on read that is legal and, consequently, is not going to be + * re-thrown. In case a transaction is rolled back and items are re-read, this + * callback occurs repeatedly for the same cause. This happens only * if read items are not buffered. - * + * * @param t cause of the failure */ default void onSkipInRead(Throwable t) { @@ -43,8 +43,8 @@ default void onSkipInRead(Throwable t) { /** * This item failed on write with the given exception, and a skip was called - * for. - * + * for. + * * @param item the failed item * @param t the cause of the failure */ @@ -53,8 +53,8 @@ default void onSkipInWrite(S item, Throwable t) { /** * This item failed on processing with the given exception, and a skip was called - * for. - * + * for. + * * @param item the failed item * @param t the cause of the failure */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Step.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Step.java index 8de0f070ec..85f8088daa 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/Step.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/Step.java @@ -16,16 +16,16 @@ package org.springframework.batch.core; /** - * Batch domain interface representing the configuration of a step. As with the {@link Job}, a {@link Step} is meant to - * explicitly represent the configuration of a step by a developer, but also the ability to execute the step. - * + * Batch domain interface representing the configuration of a step. As with a {@link Job}, a {@link Step} is meant to + * explicitly represent the configuration of a step by a developer but also the ability to execute the step. + * * @author Dave Syer - * + * */ public interface Step { /** - * The key to retrieve the batch step type. + * The key to use when retrieving the batch step type. */ String STEP_TYPE_KEY = "batch.stepType"; @@ -35,7 +35,7 @@ public interface Step { String getName(); /** - * @return true if a step that is already marked as complete can be started again. + * @return {@code true} if a step that is already marked as complete can be started again. */ boolean isAllowStartIfComplete(); @@ -46,14 +46,14 @@ public interface Step { /** * Process the step and assign progress and status meta information to the {@link StepExecution} provided. The - * {@link Step} is responsible for setting the meta information and also saving it if required by the + * {@link Step} is responsible for setting the meta information and also saving it, if required by the * implementation.
- * - * It is not safe to re-use an instance of {@link Step} to process multiple concurrent executions. - * - * @param stepExecution an entity representing the step to be executed - * - * @throws JobInterruptedException if the step is interrupted externally + * + * It is not safe to reuse an instance of {@link Step} to process multiple concurrent executions. + * + * @param stepExecution an entity representing the step to be executed. + * + * @throws JobInterruptedException if the step is interrupted externally. */ void execute(StepExecution stepExecution) throws JobInterruptedException; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java index b047f3b386..ebee145314 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java @@ -65,7 +65,7 @@ public void setExitStatus(ExitStatus status) { } /** - * Public getter for the status. + * Public getter for the exit status. * * @return the {@link ExitStatus} for this contribution */ @@ -76,7 +76,7 @@ public ExitStatus getExitStatus() { /** * Increment the counter for the number of items processed. * - * @param count long amount to increment by. + * @param count The {@code long} amount to increment by. */ public void incrementFilterCount(long count) { filterCount += count; @@ -92,7 +92,7 @@ public void incrementReadCount() { /** * Increment the counter for the number of items written. * - * @param count long amount to increment by. + * @param count The {@code long} amount to increment by. */ public void incrementWriteCount(long count) { writeCount += count; @@ -101,7 +101,7 @@ public void incrementWriteCount(long count) { /** * Public access to the read counter. * - * @return the item counter. + * @return the read item counter. */ public long getReadCount() { return readCount; @@ -110,7 +110,7 @@ public long getReadCount() { /** * Public access to the write counter. * - * @return the item counter. + * @return the write item counter. */ public long getWriteCount() { return writeCount; @@ -119,7 +119,7 @@ public long getWriteCount() { /** * Public getter for the filter counter. * - * @return the filter counter + * @return the filter counter. */ public long getFilterCount() { return filterCount; @@ -143,23 +143,23 @@ public long getSkipCount() { } /** - * Increment the read skip count for this contribution + * Increment the read skip count for this contribution. */ public void incrementReadSkipCount() { readSkipCount++; } /** - * Increment the read skip count for this contribution + * Increment the read skip count for this contribution. * - * @param count long amount to increment by. + * @param count The {@code long} amount to increment by. */ public void incrementReadSkipCount(long count) { readSkipCount += count; } /** - * Increment the write skip count for this contribution + * Increment the write skip count for this contribution. */ public void incrementWriteSkipCount() { writeSkipCount++; @@ -173,14 +173,18 @@ public void incrementProcessSkipCount() { } /** - * @return the read skip count + * Public getter for the read skip count. + * + * @return the read skip count. */ public long getReadSkipCount() { return readSkipCount; } /** - * @return the write skip count + * Public getter for the write skip count. + * + * @return the write skip count. */ public long getWriteSkipCount() { return writeSkipCount; @@ -189,7 +193,7 @@ public long getWriteSkipCount() { /** * Public getter for the process skip count. * - * @return the process skip count + * @return the process skip count. */ public long getProcessSkipCount() { return processSkipCount; @@ -197,6 +201,7 @@ public long getProcessSkipCount() { /** * Public getter for the parent step execution of this contribution. + * * @return parent step execution of this contribution */ public StepExecution getStepExecution() { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java index 2ce6ae2c9b..0fb258868f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java @@ -28,9 +28,9 @@ import org.springframework.util.Assert; /** - * Batch domain object representation the execution of a step. Unlike - * {@link JobExecution}, there are additional properties related the processing - * of items such as commit count, etc. + * Batch domain object representation for the execution of a step. Unlike + * {@link JobExecution}, additional properties are related to the processing + * of items, such as commit count and others. * * @author Lucas Ward * @author Dave Syer @@ -80,9 +80,9 @@ public class StepExecution extends Entity { /** * Constructor with mandatory properties. * - * @param stepName the step to which this execution belongs - * @param jobExecution the current job execution - * @param id the id of this execution + * @param stepName The step to which this execution belongs. + * @param jobExecution The current job execution. + * @param id The ID of this execution. */ public StepExecution(String stepName, JobExecution jobExecution, Long id) { this(stepName, jobExecution); @@ -93,10 +93,10 @@ public StepExecution(String stepName, JobExecution jobExecution, Long id) { } /** - * Constructor that substitutes in null for the execution id + * Constructor that substitutes null for the execution ID. * - * @param stepName the step to which this execution belongs - * @param jobExecution the current job execution + * @param stepName The step to which this execution belongs. + * @param jobExecution The current job execution. */ public StepExecution(String stepName, JobExecution jobExecution) { super(); @@ -106,11 +106,11 @@ public StepExecution(String stepName, JobExecution jobExecution) { } /** - * Constructor that requires only a stepName. Intended only to be - * used via serialization libraries to address the circular + * Constructor that requires only a stepName. Intended only to be + * used over serialization libraries to address the circular * reference between {@link JobExecution} and StepExecution. * - * @param stepName the name of the executed step + * @param stepName The name of the executed step. */ @SuppressWarnings("unused") private StepExecution(String stepName) { @@ -121,45 +121,45 @@ private StepExecution(String stepName) { } /** - * Returns the {@link ExecutionContext} for this execution + * Returns the {@link ExecutionContext} for this execution. * - * @return the attributes + * @return the attributes. */ public ExecutionContext getExecutionContext() { return executionContext; } /** - * Sets the {@link ExecutionContext} for this execution + * Sets the {@link ExecutionContext} for this execution. * - * @param executionContext the attributes + * @param executionContext The attributes. */ public void setExecutionContext(ExecutionContext executionContext) { this.executionContext = executionContext; } /** - * Returns the current number of commits for this execution + * Returns the current number of commits for this execution. * - * @return the current number of commits + * @return the current number of commits. */ public long getCommitCount() { return commitCount; } /** - * Sets the current number of commits for this execution + * Sets the current number of commits for this execution. * - * @param commitCount the current number of commits + * @param commitCount The current number of commits. */ public void setCommitCount(long commitCount) { this.commitCount = commitCount; } /** - * Returns the time that this execution ended or {@code null} if the step is running. + * Returns the time when this execution ended or {@code null} if the step is running. * - * @return the time that this execution ended or {@code null} if the step is running + * @return the time when this execution ended or {@code null} if the step is running. */ @Nullable public Date getEndTime() { @@ -167,118 +167,118 @@ public Date getEndTime() { } /** - * Sets the time that this execution ended + * Sets the time when this execution ended. * - * @param endTime the time that this execution ended + * @param endTime The time when this execution ended. */ public void setEndTime(Date endTime) { this.endTime = endTime; } /** - * Returns the current number of items read for this execution + * Returns the current number of items read for this execution. * - * @return the current number of items read for this execution + * @return the current number of items read for this execution. */ public long getReadCount() { return readCount; } /** - * Sets the current number of read items for this execution + * Sets the current number of read items for this execution. * - * @param readCount the current number of read items for this execution + * @param readCount The current number of read items for this execution. */ public void setReadCount(long readCount) { this.readCount = readCount; } /** - * Returns the current number of items written for this execution + * Returns the current number of items written for this execution. * - * @return the current number of items written for this execution + * @return The current number of items written for this execution. */ public long getWriteCount() { return writeCount; } /** - * Sets the current number of written items for this execution + * Sets the current number of written items for this execution. * - * @param writeCount the current number of written items for this execution + * @param writeCount The current number of written items for this execution. */ public void setWriteCount(long writeCount) { this.writeCount = writeCount; } /** - * Returns the current number of rollbacks for this execution + * Returns the current number of rollbacks for this execution. * - * @return the current number of rollbacks for this execution + * @return the current number of rollbacks for this execution. */ public long getRollbackCount() { return rollbackCount; } /** - * Returns the current number of items filtered out of this execution + * Returns the current number of items filtered out of this execution. * - * @return the current number of items filtered out of this execution + * @return the current number of items filtered out of this execution. */ public long getFilterCount() { return filterCount; } /** - * Public setter for the number of items filtered out of this execution. + * Sets the number of items filtered out of this execution. * - * @param filterCount the number of items filtered out of this execution to - * set + * @param filterCount The number of items filtered out of this execution to + * set. */ public void setFilterCount(long filterCount) { this.filterCount = filterCount; } /** - * Setter for number of rollbacks for this execution + * Sets the number of rollbacks for this execution. * - * @param rollbackCount long the number of rollbacks. + * @param rollbackCount {@code long} the number of rollbacks. */ public void setRollbackCount(long rollbackCount) { this.rollbackCount = rollbackCount; } /** - * Gets the time this execution started + * Gets the time when this execution started. * - * @return the time this execution started + * @return the time when this execution started. */ public Date getStartTime() { return startTime; } /** - * Sets the time this execution started + * Sets the time when this execution started. * - * @param startTime the time this execution started + * @param startTime The time when this execution started. */ public void setStartTime(Date startTime) { this.startTime = startTime; } /** - * Returns the current status of this step + * Returns the current status of this step. * - * @return the current status of this step + * @return the current status of this step. */ public BatchStatus getStatus() { return status; } /** - * Sets the current status of this step + * Sets the current status of this step. * - * @param status the current status of this step + * @param status The current status of this step. */ public void setStatus(BatchStatus status) { this.status = status; @@ -287,25 +287,25 @@ public void setStatus(BatchStatus status) { /** * Upgrade the status field if the provided value is greater than the * existing one. Clients using this method to set the status can be sure - * that they don't overwrite a failed status with an successful one. + * that they do not overwrite a failed status with a successful one. * - * @param status the new status value + * @param status The new status value, */ public void upgradeStatus(BatchStatus status) { this.status = this.status.upgradeTo(status); } /** - * @return the name of the step + * @return the name of the step. */ public String getStepName() { return stepName; } /** - * Accessor for the job execution id. + * Accessor for the job execution ID. * - * @return the jobExecutionId + * @return the {@code jobExecutionId}. */ public Long getJobExecutionId() { if (jobExecution != null) { @@ -315,14 +315,14 @@ public Long getJobExecutionId() { } /** - * @param exitStatus {@link ExitStatus} instance used to establish the exit status. + * @param exitStatus The {@link ExitStatus} instance used to establish the exit status. */ public void setExitStatus(ExitStatus exitStatus) { this.exitStatus = exitStatus; } /** - * @return the exitCode + * @return the exit code. */ public ExitStatus getExitStatus() { return exitStatus; @@ -348,11 +348,11 @@ public StepContribution createStepContribution() { } /** - * On successful execution just before a chunk commit, this method should be - * called. Synchronizes access to the {@link StepExecution} so that changes + * This method should be called on successful execution just before a chunk commit. + * Synchronizes access to the {@link StepExecution} so that changes * are atomic. * - * @param contribution {@link StepContribution} instance used to update the StepExecution state. + * @param contribution The {@link StepContribution} instance used to update the {@code StepExecution} state. */ public synchronized void apply(StepContribution contribution) { readSkipCount += contribution.getReadSkipCount(); @@ -365,21 +365,22 @@ public synchronized void apply(StepContribution contribution) { } /** - * On unsuccessful execution after a chunk has rolled back. + * Increments the rollback count. + * Should be used on unsuccessful execution after a chunk has rolled back. */ public synchronized void incrementRollbackCount() { rollbackCount++; } /** - * @return flag to indicate that an execution should halt + * @return flag to indicate that an execution should halt. */ public boolean isTerminateOnly() { return this.terminateOnly; } /** - * Set a flag that will signal to an execution environment that this + * Sets a flag that signals to an execution environment that this * execution (and its surrounding job) wishes to exit. */ public void setTerminateOnly() { @@ -394,7 +395,7 @@ public long getSkipCount() { } /** - * Increment the number of commits + * Increment the number of commits. */ public void incrementCommitCount() { commitCount++; @@ -403,8 +404,8 @@ public void incrementCommitCount() { /** * Convenience method to get the current job parameters. * - * @return the {@link JobParameters} from the enclosing job, or empty if - * that is null + * @return the {@link JobParameters} from the enclosing job or empty if + * that is {@code null}. */ public JobParameters getJobParameters() { if (jobExecution == null) { @@ -414,32 +415,32 @@ public JobParameters getJobParameters() { } /** - * @return the number of records skipped on read + * @return the number of records skipped on read. */ public long getReadSkipCount() { return readSkipCount; } /** - * @return the number of records skipped on write + * @return the number of records skipped on write. */ public long getWriteSkipCount() { return writeSkipCount; } /** - * Set the number of records skipped on read + * Set the number of records skipped on read. * - * @param readSkipCount long containing read skip count to be used for the step execution. + * @param readSkipCount A {@code long} containing the read skip count to be used for the step execution. */ public void setReadSkipCount(long readSkipCount) { this.readSkipCount = readSkipCount; } /** - * Set the number of records skipped on write + * Set the number of records skipped on write. * - * @param writeSkipCount long containing write skip count to be used for the step execution. + * @param writeSkipCount A {@code long} containing write skip count to be used for the step execution. */ public void setWriteSkipCount(long writeSkipCount) { this.writeSkipCount = writeSkipCount; @@ -453,9 +454,9 @@ public long getProcessSkipCount() { } /** - * Set the number of records skipped during processing. + * Sets the number of records skipped during processing. * - * @param processSkipCount long containing process skip count to be used for the step execution. + * @param processSkipCount A {@code long} containing the process skip count to be used for the step execution. */ public void setProcessSkipCount(long processSkipCount) { this.processSkipCount = processSkipCount; @@ -469,17 +470,17 @@ public Date getLastUpdated() { } /** - * Set the time when the StepExecution was last updated before persisting + * Sets the time when the {@code StepExecution} was last updated before persisting. * - * @param lastUpdated {@link Date} instance used to establish the last - * updated date for the Step Execution. + * @param lastUpdated the {@link Date} instance used to establish the last + * updated date for the {@code StepExecution}. */ public void setLastUpdated(Date lastUpdated) { this.lastUpdated = lastUpdated; } /** - * @return The {@link List} of {@link Throwable} objects. + * @return the {@link List} of {@link Throwable} objects. */ public List getFailureExceptions() { return failureExceptions; @@ -518,10 +519,10 @@ public boolean equals(Object obj) { * Deserialize and ensure transient fields are re-instantiated when read * back. * - * @param stream instance of {@link ObjectInputStream}. + * @param stream An instance of {@link ObjectInputStream}. * - * @throws IOException thrown if error occurs during read. - * @throws ClassNotFoundException thrown if class is not found. + * @throws IOException If an error occurs during read. + * @throws ClassNotFoundException If the class is not found. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java index bdfebaa698..e4ad690b36 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java @@ -38,16 +38,16 @@ default void beforeStep(StepExecution stepExecution) { /** * Give a listener a chance to modify the exit status from a step. The value - * returned will be combined with the normal exit status using + * returned is combined with the normal exit status by using * {@link ExitStatus#and(ExitStatus)}. * - * Called after execution of step's processing logic (both successful or - * failed). Throwing exception in this method has no effect, it will only be + * Called after execution of the step's processing logic (whether successful or + * failed). Throwing an exception in this method has no effect, as it is only * logged. * - * @param stepExecution {@link StepExecution} instance. + * @param stepExecution a {@link StepExecution} instance. * @return an {@link ExitStatus} to combine with the normal value. Return - * {@code null} to leave the old value unchanged. + * {@code null} (the default) to leave the old value unchanged. */ @Nullable default ExitStatus afterStep(StepExecution stepExecution) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepListener.java index 005bab04b9..65b9b11606 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepListener.java @@ -17,10 +17,10 @@ /** * Marker interface that acts as a parent to all step - * domain listeners, such as: {@link StepExecutionListener}, - * {@link ChunkListener}, {@link ItemReadListener} and + * domain listeners, such as: {@link StepExecutionListener}, + * {@link ChunkListener}, {@link ItemReadListener}, and * {@link ItemWriteListener} - * + * * @author Lucas Ward * @author Dave Syer * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/UnexpectedJobExecutionException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/UnexpectedJobExecutionException.java index ec5aab2831..8926a89691 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/UnexpectedJobExecutionException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/UnexpectedJobExecutionException.java @@ -19,18 +19,18 @@ /** * Indicates to the framework that a critical error has occurred and processing * should immediately stop. - * + * * @author Lucas Ward - * + * */ public class UnexpectedJobExecutionException extends RuntimeException { private static final long serialVersionUID = 8838982304219248527L; /** * Constructs a new instance with a message. - * - * @param msg the exception message. - * + * + * @param msg The exception message. + * */ public UnexpectedJobExecutionException(String msg) { super(msg); @@ -38,10 +38,10 @@ public UnexpectedJobExecutionException(String msg) { /** * Constructs a new instance with a message. - * - * @param msg the exception message. - * @param nested instance of {@link Throwable} that is the cause of the exception. - * + * + * @param msg The exception message. + * @param nested An instance of {@link Throwable} that is the cause of the exception. + * */ public UnexpectedJobExecutionException(String msg, Throwable nested) { super(msg, nested);