From e6e21c5e18b48ae56d3743fa1a12e62a61fc1f48 Mon Sep 17 00:00:00 2001 From: Jay Bryant Date: Wed, 8 Jun 2022 09:54:35 -0500 Subject: [PATCH] Improve Javadocs --- .../BatchConfigurationException.java | 9 +- .../configuration/DuplicateJobException.java | 3 +- .../batch/core/configuration/JobFactory.java | 2 +- .../batch/core/configuration/JobRegistry.java | 4 +- .../core/configuration/StepRegistry.java | 14 +- .../AbstractBatchConfiguration.java | 20 +- .../BatchConfigurationSelector.java | 6 +- .../annotation/BatchConfigurer.java | 4 +- .../annotation/DefaultBatchConfigurer.java | 8 +- .../annotation/EnableBatchProcessing.java | 62 +++--- .../annotation/JobBuilderFactory.java | 6 +- .../configuration/annotation/JobScope.java | 11 +- .../annotation/ModularBatchConfiguration.java | 4 +- .../annotation/SimpleBatchConfiguration.java | 2 +- .../annotation/StepBuilderFactory.java | 4 +- .../configuration/annotation/StepScope.java | 13 +- .../AbstractApplicationContextFactory.java | 41 ++-- .../support/ApplicationContextFactory.java | 6 +- .../support/ApplicationContextJobFactory.java | 10 +- .../support/AutomaticJobRegistrar.java | 28 +-- ...pathXmlApplicationContextsFactoryBean.java | 31 +-- .../support/DefaultJobLoader.java | 6 +- .../GenericApplicationContextFactory.java | 23 ++- .../configuration/support/GroupAwareJob.java | 8 +- .../JobFactoryRegistrationListener.java | 4 +- .../core/configuration/support/JobLoader.java | 8 +- .../support/JobRegistryBeanPostProcessor.java | 8 +- .../support/MapStepRegistry.java | 4 +- .../support/ReferenceJobFactory.java | 10 +- .../configuration/xml/AbstractFlowParser.java | 46 +++-- .../xml/AbstractListenerParser.java | 2 + .../configuration/xml/ChunkElementParser.java | 16 +- .../configuration/xml/CoreNamespaceUtils.java | 26 ++- .../configuration/xml/FlowElementParser.java | 8 +- .../configuration/xml/InlineFlowParser.java | 15 +- .../configuration/xml/InlineStepParser.java | 12 +- .../xml/JobExecutionListenerParser.java | 4 +- .../core/configuration/xml/JobParser.java | 2 +- .../xml/SimpleFlowFactoryBean.java | 31 +-- .../core/configuration/xml/SplitParser.java | 13 +- .../xml/StandaloneStepParser.java | 8 +- .../xml/StepParserStepFactoryBean.java | 187 +++++++++--------- .../configuration/xml/TopLevelFlowParser.java | 3 +- 43 files changed, 379 insertions(+), 353 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java index 4f5782e44..1c44d1494 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ package org.springframework.batch.core.configuration; /** - * Represents an error has occurred in the configuration of base batch infrastructure - * (creation of a {@link org.springframework.batch.core.repository.JobRepository} for - * example. + * Represents that an error has occurred in the configuration of the base batch + * infrastructure (the creation of a + * {@link org.springframework.batch.core.repository.JobRepository}, for example). * * @author Michael Minella * @author Mahmoud Ben Hassine @@ -29,6 +29,7 @@ public class BatchConfigurationException extends RuntimeException { private static final long serialVersionUID = 1L; /** + * Create an exception with the given {@Link Throwable}. * @param t an exception to be wrapped */ public BatchConfigurationException(Throwable t) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java index 52a7c423a..53d5642a5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ public class DuplicateJobException extends JobExecutionException { } /** + * Create an exception with the given message and the given exception. * @param msg error message. * @param e instance of {@link Throwable} that is the cause of the exception. */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java index 1b62b7e09..dafe2035f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java @@ -32,7 +32,7 @@ public interface JobFactory { Job createJob(); /** - * @return The {@link String} containing the {@link Job} name. + * @return The {@link String} that contains the {@link Job} name. */ String getJobName(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java index bd689adec..86c4539fb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ public interface JobRegistry extends ListableJobLocator { /** * Unregisters a previously registered {@link Job}. If it was not previously - * registered there is no error. + * registered, there is no error. * @param jobName the {@link Job} to unregister. */ void unregister(String jobName); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java index fc49b73d5..c1a710d63 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import org.springframework.batch.core.step.NoSuchStepException; import java.util.Collection; /** - * Registry keeping track of all the {@link Step} defined in a + * Registry keeping track of all the {@link Step} instances defined in a * {@link org.springframework.batch.core.Job}. * * @author Sebastien Gerard @@ -31,9 +31,9 @@ import java.util.Collection; public interface StepRegistry { /** - * Registers all the step of the given job. If the job is already registered, the - * method {@link #unregisterStepsFromJob(String)} is called before registering the - * given steps. + * Registers all the step instances of the given job. If the job is already + * registered, the method {@link #unregisterStepsFromJob(String)} is called before + * registering the given steps. * @param jobName the give job name * @param steps the job steps * @throws DuplicateJobException if a job with the same job name has already been @@ -42,8 +42,8 @@ public interface StepRegistry { void register(String jobName, Collection steps) throws DuplicateJobException; /** - * Unregisters all the steps of the given job. If the job is not registered, nothing - * happens. + * Unregisters all the steps instances of the given job. If the job is not registered, + * nothing happens. * @param jobName the given job name */ void unregisterStepsFromJob(String jobName); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java index 82c56292b..5b744e77b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java @@ -37,9 +37,9 @@ import org.springframework.context.annotation.Import; import org.springframework.transaction.PlatformTransactionManager; /** - * Base {@code Configuration} class providing common structure for enabling and using - * Spring Batch. Customization is available by implementing the {@link BatchConfigurer} - * interface. + * Base {@code Configuration} class that provides a common structure for enabling and + * using Spring Batch. Customization is available by implementing the + * {@link BatchConfigurer} interface. * * @author Dave Syer * @author Michael Minella @@ -65,7 +65,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link JobBuilderFactory} for the batch execution. * @return The instance of the {@link JobBuilderFactory}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public JobBuilderFactory jobBuilders() throws Exception { @@ -75,7 +75,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link StepBuilderFactory} for the batch execution. * @return The instance of the {@link StepBuilderFactory}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public StepBuilderFactory stepBuilders() throws Exception { @@ -85,7 +85,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link JobRepository} for the batch execution. * @return The instance of the {@link JobRepository}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public abstract JobRepository jobRepository() throws Exception; @@ -93,7 +93,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link JobLauncher} for the batch execution. * @return The instance of the {@link JobLauncher}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public abstract JobLauncher jobLauncher() throws Exception; @@ -101,7 +101,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link JobExplorer} for the batch execution. * @return The instance of the {@link JobExplorer}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public abstract JobExplorer jobExplorer() throws Exception; @@ -109,7 +109,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link JobRegistry} for the batch execution. * @return The instance of the {@link JobRegistry}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public JobRegistry jobRegistry() throws Exception { @@ -119,7 +119,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link PlatformTransactionManager} for the batch execution. * @return The instance of the {@link PlatformTransactionManager}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ public abstract PlatformTransactionManager transactionManager() throws Exception; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java index 5c64e5afe..3c4519d8d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import org.springframework.core.type.AnnotationMetadata; import org.springframework.util.Assert; /** - * Base {@code Configuration} class providing common structure for enabling and using + * Base {@code Configuration} class that provides common structure for enabling and using * Spring Batch. Customization is available by implementing the {@link BatchConfigurer} * interface. * @@ -50,4 +50,4 @@ public class BatchConfigurationSelector implements ImportSelector { return imports; } -} \ No newline at end of file +} diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java index 90e1f92c9..3dac18a89 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java @@ -21,8 +21,8 @@ import org.springframework.batch.core.repository.JobRepository; import org.springframework.transaction.PlatformTransactionManager; /** - * Strategy interface for users to provide as a factory for custom components needed by a - * Batch system. + * Strategy interface that users can provide as a factory for custom components needed by + * a Batch system. * * @author Dave Syer * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java index 16d96b28b..861785f72 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java @@ -49,7 +49,7 @@ public class DefaultBatchConfigurer implements BatchConfigurer, InitializingBean /** * Create a new {@link DefaultBatchConfigurer} with the passed datasource. This - * constructor will configure a default {@link JdbcTransactionManager}. + * constructor configures a default {@link JdbcTransactionManager}. * @param dataSource to use for the job repository and job explorer */ public DefaultBatchConfigurer(DataSource dataSource) { @@ -57,10 +57,10 @@ public class DefaultBatchConfigurer implements BatchConfigurer, InitializingBean } /** - * Create a new {@link DefaultBatchConfigurer} with the passed datasource and + * Create a new {@link DefaultBatchConfigurer} with the given datasource and * transaction manager. - * @param dataSource to use for the job repository and job explorer - * @param transactionManager to use for the job repository + * @param dataSource The data source to use for the job repository and job explorer. + * @param transactionManager The transaction manager to use for the job repository. */ public DefaultBatchConfigurer(DataSource dataSource, PlatformTransactionManager transactionManager) { Assert.notNull(dataSource, "DataSource must not be null"); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java index 53184e591..840c53002 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java @@ -63,8 +63,8 @@ import org.springframework.context.annotation.Import; * } * * - * The user should provide a {@link DataSource} as a bean in the context, or else - * implement {@link BatchConfigurer} in the configuration class itself, e.g. + * You should provide a {@link DataSource} as a bean in the context or else implement + * {@link BatchConfigurer} in the configuration class itself -- for example: * *
  * @Configuration
@@ -86,16 +86,17 @@ import org.springframework.context.annotation.Import;
  * }
  * 
* - * If multiple {@link javax.sql.DataSource}s are defined in the context, the primary - * autowire candidate will be used, otherwise an exception will be thrown. + * If multiple {@link javax.sql.DataSource} instances are defined in the context, the + * primary autowire candidate is used. Otherwise, an exception is thrown. * * Note that only one of your configuration classes needs to have the * @EnableBatchProcessing annotation. Once you have an - * @EnableBatchProcessing class in your configuration you will have an - * instance of {@link StepScope} and {@link org.springframework.batch.core.scope.JobScope} - * so your beans inside steps can have @Scope("step") and - * @Scope("job") respectively. You will also be able to - * @Autowired some useful stuff into your context: + * @EnableBatchProcessing class in your configuration, you have an + * instance of {@link StepScope} and + * {@link org.springframework.batch.core.scope.JobScope}, so your beans inside steps can + * have @Scope("step") and @Scope("job") respectively. + * You can also use @Autowired to insert some useful beans into your + * context: * * * - * The transaction manager provided by this annotation will be of type - * {@link org.springframework.jdbc.support.JdbcTransactionManager} configured with the - * {@link javax.sql.DataSource} provided within the context. + * The transaction manager provided by this annotation is of type + * {@link org.springframework.jdbc.support.JdbcTransactionManager} and is configured with + * the {@link javax.sql.DataSource} provided within the context. * - * In order to use a custom transaction manager, a custom {@link BatchConfigurer} should - * be provided. For example: + * To use a custom transaction manager, you should provide a custom + * {@link BatchConfigurer} -- for example: * *
  * @Configuration
@@ -142,14 +143,13 @@ import org.springframework.context.annotation.Import;
  * }
  * 
* - * If the configuration is specified as modular=true then the context will - * also contain an {@link AutomaticJobRegistrar}. The job registrar is useful for - * modularizing your configuration if there are multiple jobs. It works by creating - * separate child application contexts containing job configurations and registering those - * jobs. The jobs can then create steps and other dependent components without needing to - * worry about bean definition name clashes. Beans of type - * {@link ApplicationContextFactory} will be registered automatically with the job - * registrar. Example: + * If the configuration is specified as modular=true, the context also + * contains an {@link AutomaticJobRegistrar}. The job registrar is useful for modularizing + * your configuration if there are multiple jobs. It works by creating separate child + * application contexts to contain job configurations and register those jobs. The jobs + * can then create steps and other dependent components without needing to worry about + * bean definition name clashes. Beans of type {@link ApplicationContextFactory} are + * automatically registered with the job registrar. Example: * *
  * @Configuration
@@ -171,12 +171,12 @@ import org.springframework.context.annotation.Import;
  * }
  * 
* - * Note that a modular parent context in general should not itself contain + * Note that a modular parent context, in general, should not itself contain * @Bean definitions for job, especially if a {@link BatchConfigurer} is provided, - * because cyclic configuration dependencies are otherwise likely to develop. + * because cyclic configuration dependencies are likely to develop. * *

- * For reference, the first example above can be compared to the following Spring XML + * For reference, compare the first example shown earlier to the following Spring XML * configuration: * *

@@ -208,11 +208,11 @@ public @interface EnableBatchProcessing {
 
 	/**
 	 * Indicate whether the configuration is going to be modularized into multiple
-	 * application contexts. If true then you should not create any @Bean Job
-	 * definitions in this context, but rather supply them in separate (child) contexts
-	 * through an {@link ApplicationContextFactory}.
+	 * application contexts. If true, you should not create any @Bean Job definitions
+	 * in this context but, rather, supply them in separate (child) contexts through an
+	 * {@link ApplicationContextFactory}.
 	 * @return boolean indicating whether the configuration is going to be modularized
-	 * into multiple application contexts. Defaults to false.
+	 * into multiple application contexts. Defaults to {@code false}.
 	 */
 	boolean modular() default false;
 
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java
index 09653e626..ed5768232 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java
@@ -20,7 +20,7 @@ import org.springframework.batch.core.repository.JobRepository;
 import org.springframework.util.Assert;
 
 /**
- * Convenient factory for a {@link JobBuilder} which sets the {@link JobRepository}
+ * Convenient factory for a {@link JobBuilder} that sets the {@link JobRepository}
  * automatically.
  *
  * @author Dave Syer
@@ -41,8 +41,8 @@ public class JobBuilderFactory {
 	}
 
 	/**
-	 * Creates a job builder and initializes its job repository. Note that if the builder
-	 * is used to create a @Bean definition then the name of the job and the bean name
+	 * Creates a job builder and initializes its job repository. Note that, if the builder
+	 * is used to create a @Bean definition, the name of the job and the bean name
 	 * might be different.
 	 * @param name the name of the job
 	 * @return a job builder
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java
index a36662185..e9af1f120 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 the original author or authors.
+ * Copyright 2013-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,10 +24,11 @@ import java.lang.annotation.RetentionPolicy;
 
 /**
  * 

- * Convenient annotation for job scoped beans that defaults the proxy mode, so that it - * doesn't have to be specified explicitly on every bean definition. Use this on any + * Convenient annotation for job-scoped beans that defaults the proxy mode, so that it + * does not have to be specified explicitly on every bean definition. Use this on any * @Bean that needs to inject @Values from the job context, and any bean that - * needs to share a lifecycle with a job execution (e.g. an JobExecutionListener). E.g. + * needs to share a lifecycle with a job execution (such as an JobExecutionListener). The + * following listing shows an example: *

* *
@@ -54,4 +55,4 @@ import java.lang.annotation.RetentionPolicy;
 @Documented
 public @interface JobScope {
 
-}
\ No newline at end of file
+}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
index 5eeb9fdd2..77aa99089 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
@@ -46,8 +46,8 @@ public class ModularBatchConfiguration extends SimpleBatchConfiguration {
 
 	/**
 	 * Creates a {@link AutomaticJobRegistrar} bean.
-	 * @return New instance of {@link AutomaticJobRegistrar}.
-	 * @throws Exception The {@link Exception} thrown if an error occurs.
+	 * @return a new instance of {@link AutomaticJobRegistrar}.
+	 * @throws an {@link Exception} if an error occurs.
 	 */
 	@Bean
 	public AutomaticJobRegistrar jobRegistrar() throws Exception {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
index d45f8f8c9..26ee63273 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
@@ -26,7 +26,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.transaction.PlatformTransactionManager;
 
 /**
- * Base {@code Configuration} class providing common structure for enabling and using
+ * Base {@code Configuration} class to provide a common structure for enabling and using
  * Spring Batch. Customization is available by implementing the {@link BatchConfigurer}
  * interface.
  *
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java
index 05312927e..aa3a8179e 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java
@@ -50,8 +50,8 @@ public class StepBuilderFactory {
 
 	/**
 	 * Creates a step builder and initializes its job repository and transaction manager.
-	 * Note that if the builder is used to create a @Bean definition then the name of
-	 * the step and the bean name might be different.
+	 * Note that, if the builder is used to create a @Bean definition, the name of the
+	 * step and the bean name might be different.
 	 * @param name the name of the step
 	 * @return a step builder
 	 */
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java
index b6c1f5a88..489ec1d70 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 the original author or authors.
+ * Copyright 2013-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,10 +24,11 @@ import java.lang.annotation.RetentionPolicy;
 
 /**
  * 

- * Convenient annotation for step scoped beans that defaults the proxy mode, so that it - * doesn't have to be specified explicitly on every bean definition. Use this on any - * @Bean that needs to inject @Values from the step context, and any bean that - * needs to share a lifecycle with a step execution (e.g. an ItemStream). E.g. + * Convenient annotation for step-scoped beans. It defaults the proxy mode so that it need + * not be specified explicitly on every bean definition. Use this on any @Bean that + * needs to inject @Values from the step context and on any bean that needs to share a + * lifecycle with a step execution (such as an ItemStream). The following listing shows an + * example: *

* *
@@ -54,4 +55,4 @@ import java.lang.annotation.RetentionPolicy;
 @Documented
 public @interface StepScope {
 
-}
\ No newline at end of file
+}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java
index 3b087c5a8..4e1b9c98d 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2021 the original author or authors.
+ * Copyright 2006-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,12 +42,11 @@ import org.springframework.util.ClassUtils;
 
 /**
  * {@link ApplicationContextFactory} implementation that takes a parent context and a path
- * to the context to create. When createApplicationContext method is called, the child
- * {@link ApplicationContext} will be returned. The child context is not re-created every
- * time it is requested, it is lazily initialized and cached. Clients should ensure that
- * it is closed when it is no longer needed. If a path is not set, the parent will always
- * be returned.
- *
+ * to the context to create. When the {@code createApplicationContext} method is called,
+ * the child {@link ApplicationContext} is returned. The child context is not re-created
+ * every time it is requested. It is lazily initialized and cached. Clients should ensure
+ * that it is closed when it is no longer needed. If a path is not set, the parent is
+ * always returned.
  */
 public abstract class AbstractApplicationContextFactory implements ApplicationContextFactory, ApplicationContextAware {
 
@@ -65,7 +64,7 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 
 	/**
 	 * Create a factory instance with the resource specified. The resources are Spring
-	 * configuration files or java packages containing configuration files.
+	 * configuration files or Java packages that contain configuration files.
 	 * @param resource resource to be used in the creation of the ApplicationContext.
 	 */
 	public AbstractApplicationContextFactory(Object... resource) {
@@ -86,8 +85,8 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	}
 
 	/**
-	 * Flag to indicate that configuration such as bean post processors and custom editors
-	 * should be copied from the parent context. Defaults to true.
+	 * Flag to indicate that configuration, such as bean post processors and custom
+	 * editors, should be copied from the parent context. Defaults to {@code true}.
 	 * @param copyConfiguration the flag value to set
 	 */
 	public void setCopyConfiguration(boolean copyConfiguration) {
@@ -95,8 +94,8 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	}
 
 	/**
-	 * Protected access for subclasses to the flag determining whether configuration
-	 * should be copied from parent context.
+	 * Protected access for subclasses to the flag that determines whether configuration
+	 * should be copied from the parent context.
 	 * @return the flag value
 	 */
 	protected final boolean isCopyConfiguration() {
@@ -104,8 +103,8 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	}
 
 	/**
-	 * Determines which bean factory post processors (like property placeholders) should
-	 * be copied from the parent context. Defaults to
+	 * Determines which bean factory post processors (such as property placeholders)
+	 * should be copied from the parent context. Defaults to
 	 * {@link PropertySourcesPlaceholderConfigurer} and {@link CustomEditorConfigurer}.
 	 * @param beanFactoryPostProcessorClasses array of post processor types to be copied
 	 */
@@ -119,10 +118,10 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	}
 
 	/**
-	 * Determines by exclusion which bean post processors should be copied from the parent
-	 * context. Defaults to {@link BeanFactoryAware} (so any post processors that have a
-	 * reference to the parent bean factory are not copied into the child). Note that
-	 * these classes do not themselves have to be {@link BeanPostProcessor}
+	 * Determines, by exclusion, which bean post processors should be copied from the
+	 * parent context. Defaults to {@link BeanFactoryAware} (so any post processors that
+	 * have a reference to the parent bean factory are not copied into the child). Note
+	 * that these classes do not themselves have to be {@link BeanPostProcessor}
 	 * implementations or sub-interfaces.
 	 * @param beanPostProcessorExcludeClasses the classes to set
 	 */
@@ -180,8 +179,8 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	 * Extension point for special subclasses that want to do more complex things with the
 	 * context prior to refresh. The default implementation does nothing.
 	 * @param parent the parent for the new application context
-	 * @param context the new application context before it is refreshed, but after bean
-	 * factory is initialized
+	 * @param context the new application context before it is refreshed but after the
+	 * bean factory is initialized
 	 *
 	 * @see AbstractApplicationContextFactory#setBeanFactoryPostProcessorClasses(Class[])
 	 */
@@ -192,7 +191,7 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	 * Extension point for special subclasses that want to do more complex things with the
 	 * bean factory prior to refresh. The default implementation copies all configuration
 	 * from the parent according to the {@link #setCopyConfiguration(boolean) flag} set.
-	 * @param parent the parent bean factory for the new context (will never be null)
+	 * @param parent the parent bean factory for the new context (can never be null)
 	 * @param beanFactory the new bean factory before bean definitions are loaded
 	 *
 	 * @see AbstractApplicationContextFactory#setCopyConfiguration(boolean)
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java
index 1cab43fef..764766197 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.context.ConfigurableApplicationContext;
 
 /**
- * Factory for the creation of {@link ApplicationContext}s. This interface is primarily
- * useful when creating a new {@link ApplicationContext} per execution of a {@link Job}.
+ * Factory for the creation of {@link ApplicationContext} instances. This interface is
+ * primarily useful when creating a new {@link ApplicationContext} for a {@link Job}.
  *
  * @author Lucas Ward
  */
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
index 34b486e92..b066ed0dc 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2013 the original author or authors.
+ * Copyright 2006-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,9 +32,9 @@ public class ApplicationContextJobFactory implements JobFactory {
 	private final Job job;
 
 	/**
-	 * @param jobName the id of the {@link Job} in the application context to be created
-	 * @param applicationContextFactory a factory for an application context containing a
-	 * job with the job name provided
+	 * @param jobName the ID of the {@link Job} in the application context to be created.
+	 * @param applicationContextFactory a factory for an application context that contains
+	 * a job with the job name provided.
 	 */
 	public ApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory) {
 		@SuppressWarnings("resource")
@@ -54,7 +54,7 @@ public class ApplicationContextJobFactory implements JobFactory {
 	}
 
 	/**
-	 * Just return the name of instance passed in on initialization.
+	 * Return the name of the instance passed in on initialization.
 	 *
 	 * @see JobFactory#getJobName()
 	 */
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java
index e1da66ab1..75982559b 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2018 the original author or authors.
+ * Copyright 2006-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,9 +33,9 @@ import org.springframework.util.Assert;
 
 /**
  * Loads and unloads {@link Job Jobs} when the application context is created and
- * destroyed. Each resource provided is loaded as an application context with the current
- * context as its parent, and then all the jobs from the child context are registered
- * under their bean names. A {@link JobRegistry} is required.
+ * destroyed. Each provided resource is loaded as an application context with the current
+ * context as its parent. Then all the jobs from the child context are registered under
+ * their bean names. A {@link JobRegistry} is required.
  *
  * @author Lucas Ward
  * @author Dave Syer
@@ -61,9 +61,9 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	private int order = Ordered.LOWEST_PRECEDENCE;
 
 	/**
-	 * The enclosing application context, which can be used to check if
+	 * The enclosing application context, which you can use to check whether
 	 * {@link ApplicationContextEvent events} come from the expected source.
-	 * @param applicationContext the enclosing application context if there is one
+	 * @param applicationContext the enclosing application context, if there is one
 	 * @see ApplicationContextAware#setApplicationContext(ApplicationContext)
 	 */
 	@Override
@@ -72,7 +72,8 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	}
 
 	/**
-	 * Add some factories to the set that will be used to load contexts and jobs.
+	 * Add a single {@link ApplicationContextFactory} to the set that is used to load
+	 * contexts and jobs.
 	 * @param applicationContextFactory the {@link ApplicationContextFactory} values to
 	 * use
 	 */
@@ -84,7 +85,8 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	}
 
 	/**
-	 * Add some factories to the set that will be used to load contexts and jobs.
+	 * Add an array of {@link ApplicationContextFactory} instances to the set that is used
+	 * to load contexts and jobs.
 	 * @param applicationContextFactories the {@link ApplicationContextFactory} values to
 	 * use
 	 */
@@ -95,7 +97,7 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	}
 
 	/**
-	 * The job loader that will be used to load and manage jobs.
+	 * The job loader that is used to load and manage jobs.
 	 * @param jobLoader the {@link JobLoader} to set
 	 */
 	public void setJobLoader(JobLoader jobLoader) {
@@ -108,7 +110,7 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	}
 
 	/**
-	 * The order to start up and shutdown.
+	 * The order in which to start up and shutdown.
 	 * @param order the order (default {@link Ordered#LOWEST_PRECEDENCE}).
 	 * @see Ordered
 	 */
@@ -163,8 +165,8 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	}
 
 	/**
-	 * Check if this component has been started.
-	 * @return true if started successfully and not stopped
+	 * Check whether this component has been started.
+	 * @return {@code true} if started successfully and not stopped.
 	 * @see Lifecycle#isRunning()
 	 */
 	@Override
@@ -180,7 +182,7 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	}
 
 	/**
-	 * @param autoStartup true for auto start.
+	 * @param autoStartup {@code true} for auto start.
 	 * @see #isAutoStartup()
 	 */
 	public void setAutoStartup(boolean autoStartup) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java
index 38696035e..316c36452 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2021 the original author or authors.
+ * Copyright 2006-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,10 +51,11 @@ public class ClasspathXmlApplicationContextsFactoryBean
 	private ApplicationContext applicationContext;
 
 	/**
-	 * A set of resources to load using a {@link GenericApplicationContextFactory}. Each
-	 * resource should be a Spring configuration file which is loaded into an application
-	 * context whose parent is the current context. In a configuration file the resources
-	 * can be given as a pattern (e.g. classpath*:/config/*-context.xml).
+	 * A set of resources to load by using a {@link GenericApplicationContextFactory}.
+	 * Each resource should be a Spring configuration file that is loaded into an
+	 * application context whose parent is the current context. In a configuration file,
+	 * the resources can be given as a pattern (for example,
+	 * classpath*:/config/*-context.xml).
 	 * @param resources array of resources to use
 	 */
 	public void setResources(Resource[] resources) {
@@ -62,8 +63,8 @@ public class ClasspathXmlApplicationContextsFactoryBean
 	}
 
 	/**
-	 * Flag to indicate that configuration such as bean post processors and custom editors
-	 * should be copied from the parent context. Defaults to true.
+	 * Flag to indicate that configuration, such as bean post processors and custom
+	 * editors, should be copied from the parent context. Defaults to {@code true}.
 	 * @param copyConfiguration the flag value to set
 	 */
 	public void setCopyConfiguration(boolean copyConfiguration) {
@@ -71,8 +72,8 @@ public class ClasspathXmlApplicationContextsFactoryBean
 	}
 
 	/**
-	 * Determines which bean factory post processors (like property placeholders) should
-	 * be copied from the parent context. Defaults to
+	 * Determines which bean factory post processors (such as property placeholders)
+	 * should be copied from the parent context. Defaults to
 	 * {@link PropertySourcesPlaceholderConfigurer} and {@link CustomEditorConfigurer}.
 	 * @param beanFactoryPostProcessorClasses post processor types to be copied
 	 */
@@ -83,10 +84,10 @@ public class ClasspathXmlApplicationContextsFactoryBean
 	}
 
 	/**
-	 * Determines by exclusion which bean post processors should be copied from the parent
-	 * context. Defaults to {@link BeanFactoryAware} (so any post processors that have a
-	 * reference to the parent bean factory are not copied into the child). Note that
-	 * these classes do not themselves have to be {@link BeanPostProcessor}
+	 * Determines, by exclusion, which bean post processors should be copied from the
+	 * parent context. Defaults to {@link BeanFactoryAware} (so any post processors that
+	 * have a reference to the parent bean factory are not copied into the child). Note
+	 * that these classes do not themselves have to be {@link BeanPostProcessor}
 	 * implementations or sub-interfaces.
 	 * @param beanPostProcessorExcludeClasses the classes to set
 	 */
@@ -124,7 +125,7 @@ public class ClasspathXmlApplicationContextsFactoryBean
 	}
 
 	/**
-	 * The type of object returned by this factory - an array of
+	 * The type of object returned by this factory as an array of
 	 * {@link ApplicationContextFactory}.
 	 * @return array of {@link ApplicationContextFactory}
 	 * @see FactoryBean#getObjectType()
@@ -136,7 +137,7 @@ public class ClasspathXmlApplicationContextsFactoryBean
 
 	/**
 	 * Optimization hint for bean factory.
-	 * @return true
+	 * @return {@code true}
 	 * @see FactoryBean#isSingleton()
 	 */
 	@Override
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
index 9a544d668..a8e7af03c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2018 the original author or authors.
+ * Copyright 2006-2022 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
 	private Map> contextToJobNames = new ConcurrentHashMap<>();
 
 	/**
-	 * Default constructor useful for declarative configuration.
+	 * Default constructor. Useful for declarative configuration.
 	 */
 	public DefaultJobLoader() {
 		this(null, null);
@@ -246,7 +246,7 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
 	/**
 	 * Registers the specified {@link Job} defined in the specified
 	 * {@link ConfigurableApplicationContext}. 
- * Makes sure to update the {@link StepRegistry} if it is available. + * Updates the {@link StepRegistry} if it is available. * @param context the context in which the job is defined * @param job the job to register * @throws DuplicateJobException if that job is already registered diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java index 6e263c100..fb2c87e26 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,22 +35,21 @@ import java.util.List; /** * {@link ApplicationContextFactory} implementation that takes a parent context and a path - * to the context to create. When createApplicationContext method is called, the child - * {@link ApplicationContext} will be returned. The child context is not re-created every - * time it is requested, it is lazily initialized and cached. Clients should ensure that - * it is closed when it is no longer needed. - * + * to the context to create. When the {@code createApplicationContext} method is called, + * the child {@link ApplicationContext} is returned. The child context is not re-created + * every time it is requested. It is lazily initialized and cached. Clients should ensure + * that it is closed when it is no longer needed. */ public class GenericApplicationContextFactory extends AbstractApplicationContextFactory { /** - * Create an application context factory for the resource specified. The resource can - * be an actual {@link Resource}, in which case it will be interpreted as an XML file, - * or it can be a @Configuration class, or a package name. All types must be the - * same (mixing XML with a java package for example is not allowed and will result in - * an {@link java.lang.IllegalArgumentException}). + * Create an application context factory for the specified resource. The resource can + * be an actual {@link Resource} (in which case, it is interpreted as an XML file), or + * it can be a @Configuration class or a package name. All types must be the same + * (mixing XML with a Java package, for example, is not allowed and results in an + * {@link java.lang.IllegalArgumentException}). * @param resources some resources (XML configuration files, @Configuration - * classes or java packages to scan) + * classes, or Java packages to scan) */ public GenericApplicationContextFactory(Object... resources) { super(resources); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java index a5cbbfe0e..7c50d964b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2018 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import org.springframework.util.ClassUtils; /** * A {@link Job} that can optionally prepend a group name to another job's name, to make - * it fit a naming convention for type or origin. E.g. the source job might be - * overnightJob and the group financeDepartment, which would - * result in a {@link Job} with identical functionality but named + * it fit a naming convention for type or origin. For example, the source job might be + * overnightJob and the group might be financeDepartment, which + * would result in a {@link Job} with identical functionality but named * financeDepartment.overnightJob . The use of a "." separator for elements * is deliberate, since it is a "safe" character in a * URL. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java index 9cf3705ab..2b17f4b8f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ public class JobFactoryRegistrationListener { } /** - * Take the {@link JobFactory} provided and unregister it with the + * Take the provided {@link JobFactory} and unregister it with the * {@link JobRegistry}. * @param jobFactory a {@link JobFactory} * @param params not needed by this listener. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java index d0df080c5..e4821843f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2013 the original author or authors. + * Copyright 2009-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,9 +36,9 @@ public interface JobLoader { /** * Load an application context and register all the jobs, having first unregistered - * them if already registered. Implementations should also take care to close and - * clean up the application context previously created if possible (either from this - * factory or from one with the same jobs). + * them if already registered. Implementations should also close and clean up the + * application context previously created (either from this factory or from one with + * the same jobs), if possible. * @param factory a factory for an application context (containing jobs) * @return a collection of the jobs created */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java index 67ff99555..6bcb32b0e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.springframework.util.Assert; /** * A {@link BeanPostProcessor} that registers {@link Job} beans with a - * {@link JobRegistry}. Include a bean of this type along with your job configuration, and + * {@link JobRegistry}. Include a bean of this type along with your job configuration and * use the same {@link JobRegistry} as a {@link JobLocator} when you need to locate a * {@link Job} to launch. * @@ -118,7 +118,7 @@ public class JobRegistryBeanPostProcessor } /** - * If the bean is an instance of {@link Job} then register it. + * If the bean is an instance of {@link Job}, then register it. * @throws FatalBeanException if there is a {@link DuplicateJobException}. * * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, @@ -151,7 +151,7 @@ public class JobRegistryBeanPostProcessor } /** - * Determine a group name for the job to be registered. Default implementation just + * Determine a group name for the job to be registered. The default implementation * returns the {@link #setGroupName(String) groupName} configured. Provides an * extension point for specialised subclasses. * @param beanDefinition the bean definition for the job diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java index 262c6b9e7..0d3aa396b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import org.springframework.util.Assert; /** * Simple map-based implementation of {@link StepRegistry}. Access to the map is - * synchronized, guarded by an internal lock. + * synchronized and guarded by an internal lock. * * @author Sebastien Gerard * @author Stephane Nicoll diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java index bb8fda56a..f30ef213e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ import org.springframework.batch.core.Job; import org.springframework.batch.core.configuration.JobFactory; /** - * A {@link JobFactory} that just keeps a reference to a {@link Job}. It never modifies - * its {@link Job}. + * A {@link JobFactory} that keeps a reference to a {@link Job}. It never modifies its + * {@link Job}. * * @author Dave Syer * @@ -37,7 +37,7 @@ public class ReferenceJobFactory implements JobFactory { } /** - * Just return the instance passed in on initialization. + * Return the instance that was passed in on initialization. * * @see JobFactory#createJob() */ @@ -47,7 +47,7 @@ public class ReferenceJobFactory implements JobFactory { } /** - * Just return the name of instance passed in on initialization. + * Return the name of the instance that was passed in on initialization. * * @see JobFactory#getJobName() */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java index 90283ce9d..803b02f8e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java @@ -151,6 +151,7 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** + * Performs the parsing for a flow definition. * @param element the top level element containing a flow definition * @param parserContext the {@link ParserContext} */ @@ -249,11 +250,11 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** - * Find all of the elements reachable from the startElement. - * @param startElement name of the element to start from + * Find all of the elements that are reachable from the {@code startElement}. + * @param startElement Name of the element to start from * @param reachableElementMap Map of elements that can be reached from the * startElement - * @param accumulator a collection of reachable element names + * @param accumulator A collection of reachable element names */ protected void findAllReachableElements(String startElement, Map> reachableElementMap, Set accumulator) { @@ -270,9 +271,9 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** - * @param parserContext the parser context for the bean factory + * @param parserContext The parser context for the bean factory * @param stateDef The bean definition for the current state - * @param element the <step/gt; element to parse + * @param element The <step/gt; element to parse * @return a collection of * {@link org.springframework.batch.core.job.flow.support.StateTransition} references */ @@ -282,10 +283,11 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** - * @param parserContext the parser context for the bean factory - * @param stepId the id of the current state if it is a step state, null otherwise + * Retrieve a list of {@link StateTransition} instances from a {@link ParserContext}. + * @param parserContext The parser context for the bean factory + * @param stepId The ID of the current state if it is a step state, null otherwise * @param stateDef The bean definition for the current state - * @param element the <step/gt; element to parse + * @param element The <step/gt; element to parse * @return a collection of * {@link org.springframework.batch.core.job.flow.support.StateTransition} references */ @@ -330,10 +332,12 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** + * Verifies that {@code transitionElement} is not in the list of state transition + * patterns. * @param transitionElement The element to parse - * @param patterns a list of patterns on state transitions for this element - * @param element {@link Element} representing the source. - * @param parserContext the parser context for the bean factory + * @param patterns A list of patterns on state transitions for this element + * @param element The {@link Element} representing the source. + * @param parserContext The parser context for the bean factory */ protected static void verifyUniquePattern(Element transitionElement, List patterns, Element element, ParserContext parserContext) { @@ -348,7 +352,7 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar /** * @param transitionElement The element to parse * @param stateDef The bean definition for the current state - * @param parserContext the parser context for the bean factory + * @param parserContext The parser context for the bean factory * @return a collection of * {@link org.springframework.batch.core.job.flow.support.StateTransition} references */ @@ -379,8 +383,8 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar * @param exitCode The exit code that this transition will set. Use null to default to * batchStatus. * @param stateDef The bean definition for the current state - * @param parserContext the parser context for the bean factory - * @param abandon the abandon flag to be used by the transition. + * @param parserContext The parser context for the bean factory + * @param abandon The {@code abandon} flag to be used by the transition. * @return a collection of * {@link org.springframework.batch.core.job.flow.support.StateTransition} references */ @@ -425,8 +429,9 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** + * Gets the batch status from the end transition name by the element. * @param elementName An end transition element name - * @return the BatchStatus corresponding to the transition name + * @return the {@link BatchStatus} corresponding to the transition name. */ protected static FlowExecutionStatus getBatchStatusFromEndTransitionName(String elementName) { elementName = stripNamespace(elementName); @@ -445,7 +450,7 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** - * Strip the namespace from the element name if it exists. + * Strip the namespace from the element name, if it exists. */ private static String stripNamespace(String elementName) { if (elementName.startsWith("batch:")) { @@ -457,10 +462,11 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar } /** - * @param parserContext the parser context - * @param stateDefinition a reference to the state implementation - * @param on the pattern value - * @param next the next step id + * Gets a reference to the state transition. + * @param parserContext The parser context + * @param stateDefinition A reference to the state implementation + * @param on The pattern value + * @param next The next step id * @return a bean definition for a * {@link org.springframework.batch.core.job.flow.support.StateTransition} */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java index 8b6e93c11..0d4bdbafb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java @@ -135,12 +135,14 @@ public abstract class AbstractListenerParser { } /** + * Gets the bean class. * @return The {@link Class} for the implementation of * {@link AbstractListenerFactoryBean}. */ protected abstract Class> getBeanClass(); /** + * Gets the metadata values. * @return The array of {@link ListenerMetaData}. */ protected abstract ListenerMetaData[] getMetaDataValues(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java index 95988cf7d..7e9ab5ef4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,10 +68,11 @@ public class ChunkElementParser { StepListenerMetaData.itemListenerMetaData()); /** - * @param bd {@link AbstractBeanDefinition} instance of the containing bean. - * @param element the element to parse - * @param parserContext the context to use - * @param underspecified if true, a fatal error will not be raised if attribute or + * Do the parsing. + * @param bd An {@link AbstractBeanDefinition} instance of the containing bean. + * @param element The element to parse + * @param parserContext The context to use + * @param underspecified If true, a fatal error is not raised if the attribute or the * element is missing. */ protected void parse(Element element, AbstractBeanDefinition bd, ParserContext parserContext, @@ -203,7 +204,7 @@ public class ChunkElementParser { } /** - * Handle the ItemReader, ItemProcessor, and ItemWriter attributes/elements. + * Handle the ItemReader, ItemProcessor, and ItemWriter attributes and elements. */ private void handleItemHandler(AbstractBeanDefinition enclosing, String handlerName, String propertyName, String adapterClassName, boolean required, Element element, ParserContext parserContext, @@ -264,7 +265,8 @@ public class ChunkElementParser { } /** - * Handle the adapter-method attribute by using an AbstractMethodInvokingDelegator + * Handle the adapter method attribute by using an + * {@link AbstractMethodInvokingDelegator}. */ private void handleAdapterMethodAttribute(String propertyName, String adapterClassName, MutablePropertyValues stepPvs, Element element) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java index 9705c9afc..e7b40b355 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java @@ -32,7 +32,7 @@ import java.util.Comparator; import java.util.Map; /** - * Utility methods used in parsing of the batch core namespace + * Utility methods used in parsing of the batch core namespace. * * @author Thomas Risberg * @author Michael Minella @@ -101,7 +101,7 @@ public class CoreNamespaceUtils { } /** - * Register a {@link Comparator} to be used to sort {@link StateTransition}s + * Register a {@link Comparator} to be used to sort {@link StateTransition} objects. * @param parserContext */ private static void addStateTransitionComparator(ParserContext parserContext) { @@ -119,7 +119,7 @@ public class CoreNamespaceUtils { } /** - * Register a RangePropertyEditor if one does not already exist. + * Register a {@code RangePropertyEditor}, if one does not already exist. * @param parserContext */ private static void addRangePropertyEditor(ParserContext parserContext) { @@ -160,6 +160,7 @@ public class CoreNamespaceUtils { } /** + * Add a core name postprocessor. * @param parserContext */ private static void addCoreNamespacePostProcessor(ParserContext parserContext) { @@ -183,18 +184,18 @@ public class CoreNamespaceUtils { } /** - * Should this element be treated as incomplete? If it has a parent or is abstract, - * then it may not have all properties. + * Should this element be treated as incomplete? If it has a parent or is abstract, it + * may not have all properties. * @param element to be evaluated. - * @return TRUE if the element is abstract or has a parent + * @return {@code true} if the element is abstract or has a parent. */ public static boolean isUnderspecified(Element element) { return isAbstract(element) || StringUtils.hasText(element.getAttribute("parent")); } /** - * @param element to be evaluated. - * @return TRUE if the element is abstract + * @param element The element to be evaluated. + * @return {@code true} if the element is abstract. */ public static boolean isAbstract(Element element) { String abstractAttr = element.getAttribute("abstract"); @@ -203,12 +204,9 @@ public class CoreNamespaceUtils { /** * Check that the schema location declared in the source file being parsed matches the - * Spring Batch version. (The old 2.0 schema is not 100% compatible with the new - * parser, so it is an error to explicitly define 2.0. It might be an error to declare - * spring-batch.xsd as an alias, but you are only going to find that out when one of - * the sub parses breaks.) - * @param element the element that is to be parsed next - * @return true if we find a schema declaration that matches + * Spring Batch version. + * @param element The element that is to be parsed next. + * @return {@code true} if we find a schema declaration that matches. */ public static boolean namespaceMatchesVersion(Element element) { return matchesVersionInternal(element) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java index 1a524b367..4742e4ea4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2008 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,11 +40,11 @@ public class FlowElementParser { /** * Parse the flow and turn it into a list of transitions. - * @param element the <flow/gt; element to parse - * @param parserContext the parser context for the bean factory + * @param element The <flow/gt; element to parse. + * @param parserContext The parser context for the bean factory. * @return a collection of bean definitions for * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances - * objects + * objects. */ public Collection parse(Element element, ParserContext parserContext) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java index 6a9157960..e65729e96 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2014 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,10 +33,10 @@ public class InlineFlowParser extends AbstractFlowParser { /** * Construct a {@link InlineFlowParser} with the specified name and using the provided - * job repository ref. - * @param flowName the name of the flow - * @param jobFactoryRef the reference to the {@link JobParserJobFactoryBean} from the - * enclosing tag + * job repository reference. + * @param flowName The name of the flow. + * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} from the + * enclosing tag. */ public InlineFlowParser(String flowName, String jobFactoryRef) { this.flowName = flowName; @@ -50,8 +50,9 @@ public class InlineFlowParser extends AbstractFlowParser { } /** - * @param element the top level element containing a flow definition - * @param parserContext the {@link ParserContext} + * Does the parsing. + * @param element The top level element containing a flow definition. + * @param parserContext The {@link ParserContext}. */ @Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java index f342c1af1..22fa9bb18 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,13 +40,13 @@ public class InlineStepParser extends AbstractStepParser { /** * Parse the step and turn it into a list of transitions. - * @param element the <step/gt; element to parse - * @param parserContext the parser context for the bean factory - * @param jobFactoryRef the reference to the {@link JobParserJobFactoryBean} from the - * enclosing tag + * @param element The <step/gt; element to parse. + * @param parserContext The parser context for the bean factory. + * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} from the + * enclosing tag. * @return a collection of bean definitions for * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances - * objects + * objects. */ public Collection parse(Element element, ParserContext parserContext, String jobFactoryRef) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java index 56300a742..20b7f2c75 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import org.springframework.batch.core.listener.JobListenerMetaData; import org.springframework.batch.core.listener.ListenerMetaData; /** - * Parser for a step listener element. Builds a {@link JobListenerFactoryBean} using + * Parser for a step listener element. Builds a {@link JobListenerFactoryBean} by using * attributes from the configuration. * * @author Dan Garrette diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java index 0a75ac4d6..d7ff6d8d7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java @@ -155,7 +155,7 @@ public class JobParser extends AbstractSingleBeanDefinitionParser { * Parse the element to retrieve {@link BeanMetadataElement}. * @param element The {@link Element} to be parsed. * @param parserContext The {@link ParserContext}. - * @return The {@link BeanMetadataElement} extracted from the element parameter. + * @return the {@link BeanMetadataElement} extracted from the element parameter. */ public BeanMetadataElement parseBeanElement(Element element, ParserContext parserContext) { String refAttribute = element.getAttribute(REF_ATTR); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java index 52723b952..8e383e695 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java @@ -35,10 +35,10 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; /** - * Convenience factory for SimpleFlow instances for use in XML namespace. It replaces the - * states in the input with proxies that have a unique name formed from the flow name and - * the original state name (unless the name is already in that form, in which case it is - * not modified). + * Convenience factory for {@link SimpleFlow} instances for use in the XML namespace. It + * replaces the states in the input with proxies that have a unique name formed from the + * flow name and the original state name (unless the name is already in that form -- in + * that case, it is not modified). * * @author Dave Syer * @author Michael Minella @@ -57,14 +57,14 @@ public class SimpleFlowFactoryBean implements FactoryBean, Initializ /** * @param stateTransitionComparator {@link Comparator} implementation that addresses - * the ordering of state evaluation + * the ordering of state evaluation. */ public void setStateTransitionComparator(Comparator stateTransitionComparator) { this.stateTransitionComparator = stateTransitionComparator; } /** - * @param flowType Used to inject the type of flow (regular Spring Batch or JSR-352) + * @param flowType Used to inject the type of flow (regular Spring Batch or JSR-352). */ public void setFlowType(Class flowType) { this.flowType = flowType; @@ -80,8 +80,8 @@ public class SimpleFlowFactoryBean implements FactoryBean, Initializ } /** - * The raw state transitions for the flow. They will be transformed into proxies that - * have the same behavior but unique names prefixed with the flow name. + * The raw state transitions for the flow. They are transformed into proxies that have + * the same behavior but unique names prefixed with the flow name. * @param stateTransitions the list of transitions */ public void setStateTransitions(List stateTransitions) { @@ -134,8 +134,8 @@ public class SimpleFlowFactoryBean implements FactoryBean, Initializ /** * Convenience method to get a state that proxies the input but with a different name, - * appropriate to this flow. If the state is a StepState then the step name is also - * changed. + * appropriate to this flow. If the state is a {@link StepState}, the step name is + * also changed. * @param state * @return */ @@ -153,11 +153,11 @@ public class SimpleFlowFactoryBean implements FactoryBean, Initializ /** * Provides an extension point to provide alternative {@link StepState} - * implementations within a {@link SimpleFlow} - * @param state The state that will be used to create the StepState - * @param oldName The name to be replaced - * @param stateName The name for the new State - * @return a state for the requested data + * implementations within a {@link SimpleFlow}. + * @param state The state that is used to create the {@code StepState}. + * @param oldName The name to be replaced. + * @param stateName The name for the new State. + * @return a state for the requested data. */ protected State createNewStepState(State state, String oldName, String stateName) { return new StepState(stateName, ((StepState) state).getStep(oldName)); @@ -190,6 +190,7 @@ public class SimpleFlowFactoryBean implements FactoryBean, Initializ } /** + * Gets the current state. * @return The {@link State} being used by the factory bean. */ public State getState() { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java index 7684f9d9b..0f00024e5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2008 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,9 +48,10 @@ public class SplitParser { private final String jobFactoryRef; /** - * Construct a {@link InlineFlowParser} using the provided job repository ref. - * @param jobFactoryRef the reference to the {@link JobParserJobFactoryBean} from the - * enclosing tag + * Construct a {@link InlineFlowParser} by using the provided job repository + * reference. + * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} from the + * enclosing tag. */ public SplitParser(String jobFactoryRef) { this.jobFactoryRef = jobFactoryRef; @@ -58,8 +59,8 @@ public class SplitParser { /** * Parse the split and turn it into a list of transitions. - * @param element the <split/gt; element to parse - * @param parserContext the parser context for the bean factory + * @param element The <split/gt; element to parse + * @param parserContext The parser context for the bean factory * @return a collection of bean definitions for * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances * objects diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java index 90517d6bf..2b07ad967 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,9 +31,9 @@ public class StandaloneStepParser extends AbstractStepParser { /** * Parse the step and turn it into a list of transitions. - * @param element the <step/gt; element to parse - * @param parserContext the parser context for the bean factory - * @return {@link AbstractBeanDefinition} instance. + * @param element The <step/gt; element to parse + * @param parserContext The parser context for the bean factory + * @return an {@link AbstractBeanDefinition} instance. */ public AbstractBeanDefinition parse(Element element, ParserContext parserContext) { return parseStep(element, parserContext, null); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java index 6ba064cd5..02d1edbc9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java @@ -78,9 +78,9 @@ import org.springframework.util.Assert; /** * This {@link FactoryBean} is used by the batch namespace parser to create {@link Step} - * objects. Stores all of the properties that are configurable on the <step/> (and - * its inner <tasklet/>). Based on which properties are configured, the - * {@link #getObject()} method will delegate to the appropriate class for generating the + * objects. It stores all of the properties that are configurable on the <step/> + * (and its inner <tasklet/>). Based on which properties are configured, the + * {@link #getObject()} method delegates to the appropriate class for generating the * {@link Step}. * * @author Dan Garrette @@ -252,6 +252,10 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } } + /** + * Currently, all step implementations other than {@link TaskletStep} are instances of + * {@link AbstractStep} and do not require a transaction manager. + */ public boolean requiresTransactionManager() { // Currently all step implementations other than TaskletStep are // AbstractStep and do not require a transaction manager @@ -259,6 +263,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** + * Enhances a step with attributes from the provided {@link StepBuilderHelper}. * @param builder {@link StepBuilderHelper} representing the step to be enhanced */ protected void enhanceCommonStep(StepBuilderHelper builder) { @@ -279,7 +284,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Create a partition {@link Step}. - * @return The {@link Step}. + * @return the {@link Step}. */ protected Step createPartitionStep() { @@ -308,7 +313,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Creates a fault tolerant {@link Step}. - * @return The {@link Step}. + * @return the {@link Step}. */ protected Step createFaultTolerantStep() { @@ -393,7 +398,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Creates a new {@link FaultTolerantStepBuilder}. * @param stepName The name of the step used by the created builder. - * @return The {@link FaultTolerantStepBuilder}. + * @return the {@link FaultTolerantStepBuilder}. */ protected FaultTolerantStepBuilder getFaultTolerantStepBuilder(String stepName) { return new FaultTolerantStepBuilder<>(new StepBuilder(stepName)); @@ -413,7 +418,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Creates a new {@link TaskletStep}. - * @return The {@link TaskletStep}. + * @return the {@link TaskletStep}. */ protected Step createSimpleStep() { SimpleStepBuilder builder = getSimpleStepBuilder(name); @@ -444,6 +449,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** + * Create a new {@link TaskletStep}. * @return a new {@link TaskletStep} */ protected TaskletStep createTaskletStep() { @@ -502,7 +508,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Create a new {@link org.springframework.batch.core.job.flow.FlowStep}. - * @return The {@link org.springframework.batch.core.job.flow.FlowStep}. + * @return the {@link org.springframework.batch.core.job.flow.FlowStep}. */ protected Step createFlowStep() { FlowStepBuilder builder = new StepBuilder(name).flow(flow); @@ -521,7 +527,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * Validates that all components required to build a fault tolerant step are set + * Validates that all components required to build a fault tolerant step are set. */ protected void validateFaultTolerantSettings() { validateDependency("skippable-exception-classes", skippableExceptionClasses, "skip-limit", skipLimit, true); @@ -535,16 +541,16 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * Check if a field is present then a second is also. If the twoWayDependency flag is - * set then the opposite must also be true: if the second value is present, the first - * must also be. - * @param dependentName the name of the first field - * @param dependentValue the value of the first field - * @param name the name of the other field (which should be absent if the first is - * present) - * @param value the value of the other field - * @param twoWayDependency true if both depend on each other - * @throws IllegalArgumentException if either condition is violated + * Check that, if a field is present, then a second field is also present. If the + * {@code twoWayDependency} flag is set, the opposite must also be true: if the second + * value is present, the first value must also be present. + * @param dependentName The name of the first field. + * @param dependentValue The value of the first field. + * @param name The name of the other field (which should be absent if the first is + * present). + * @param value The value of the other field. + * @param twoWayDependency Set to {@code true} if both depend on each other. + * @throws an IllegalArgumentException if either condition is violated */ private void validateDependency(String dependentName, Object dependentValue, String name, Object value, boolean twoWayDependency) { @@ -560,8 +566,8 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Is the object non-null (or if an Integer, non-zero)? - * @param o an object - * @return true if the object has a value + * @param o An object + * @return {@code true} if the object has a value */ private boolean isPresent(Object o) { if (o instanceof Integer) { @@ -577,8 +583,9 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * @return true if the step is configured with any components that require fault - * tolerance + * Indicates whether the step has any components that require fault tolerance. + * @return {@code true} if the step is configured with any components that require + * fault tolerance. */ protected boolean isFaultTolerant() { return backOffPolicy != null || skipPolicy != null || retryPolicy != null || isPositive(skipLimit) @@ -677,21 +684,21 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * @return stepExecutionAggregator the current step's {@link StepExecutionAggregator} + * @return The current step's {@link StepExecutionAggregator} */ protected StepExecutionAggregator getStepExecutionAggergator() { return this.stepExecutionAggregator; } /** - * @param partitionHandler the partitionHandler to set + * @param partitionHandler The partitionHandler to set */ public void setPartitionHandler(PartitionHandler partitionHandler) { this.partitionHandler = partitionHandler; } /** - * @return partitionHandler the current step's {@link PartitionHandler} + * @return The current step's {@link PartitionHandler} */ protected PartitionHandler getPartitionHandler() { return this.partitionHandler; @@ -726,7 +733,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * @return jobRepository + * @return The jobRepository */ public JobRepository getJobRepository() { return jobRepository; @@ -741,7 +748,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * The number of times that the step should be allowed to start + * The number of times that the step should be allowed to start. * @param startLimit int containing the number of times a step should be allowed to * start. */ @@ -762,8 +769,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * @return transactionManager instance of {@link PlatformTransactionManager} used by - * the step. + * @return An instance of {@link PlatformTransactionManager} used by the step. */ public PlatformTransactionManager getTransactionManager() { return transactionManager; @@ -782,8 +788,8 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * The listeners to inject into the {@link Step}. Any instance of {@link StepListener} - * can be used, and will then receive callbacks at the appropriate stage in the step. - * @param listeners an array of listeners + * can be used and then receives callbacks at the appropriate stage in the step. + * @param listeners An array of listeners */ @SuppressWarnings("unchecked") public void setListeners(Object[] listeners) { @@ -817,28 +823,28 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Exception classes that may not cause a rollback if encountered in the right place. - * @param noRollbackExceptionClasses the noRollbackExceptionClasses to set + * @param noRollbackExceptionClasses The noRollbackExceptionClasses to set */ public void setNoRollbackExceptionClasses(Collection> noRollbackExceptionClasses) { this.noRollbackExceptionClasses = noRollbackExceptionClasses; } /** - * @param transactionTimeout the transactionTimeout to set + * @param transactionTimeout The transactionTimeout to set */ public void setTransactionTimeout(int transactionTimeout) { this.transactionTimeout = transactionTimeout; } /** - * @param isolation the isolation to set + * @param isolation The isolation to set */ public void setIsolation(Isolation isolation) { this.isolation = isolation; } /** - * @param propagation the propagation to set + * @param propagation The propagation to set */ public void setPropagation(Propagation propagation) { this.propagation = propagation; @@ -849,8 +855,8 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN // ========================================================= /** - * A backoff policy to be applied to retry process. - * @param backOffPolicy the {@link BackOffPolicy} to set + * A backoff policy to be applied to the retry process. + * @param backOffPolicy The {@link BackOffPolicy} to set */ public void setBackOffPolicy(BackOffPolicy backOffPolicy) { this.backOffPolicy = backOffPolicy; @@ -866,7 +872,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * @param retryContextCache the {@link RetryContextCache} to set + * @param retryContextCache The {@link RetryContextCache} to set */ public void setRetryContextCache(RetryContextCache retryContextCache) { this.retryContextCache = retryContextCache; @@ -874,7 +880,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * A key generator that can be used to compare items with previously recorded items in - * a retry. Only used if the reader is a transactional queue. + * a retry. Used only if the reader is a transactional queue. * @param keyGenerator the {@link KeyGenerator} to set */ public void setKeyGenerator(KeyGenerator keyGenerator) { @@ -886,33 +892,35 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN // ========================================================= /** - * Public setter for the capacity of the cache in the retry policy. If more items than - * this fail without being skipped or recovered an exception will be thrown. This is - * to guard against inadvertent infinite loops generated by item identity - * problems.
+ * + * Public setter for the capacity of the cache in the retry policy. If there are more + * items than the specified capacity, the the step fails without being skipped or + * recovered, and an exception is thrown. This guards against inadvertent infinite + * loops generated by item identity problems.
*
- * The default value should be high enough and more for most purposes. To breach the - * limit in a single-threaded step typically you have to have this many failures in a - * single transaction. Defaults to the value in the {@link MapRetryContextCache}.
- * @param cacheCapacity the cache capacity to set (greater than 0 else ignored) + * The default value should be high enough for most purposes. To breach the limit in a + * single-threaded step, you typically have to have this many failures in a single + * transaction. Defaults to the value in the {@link MapRetryContextCache}.
+ * @param cacheCapacity The cache capacity to set (greater than 0 else ignored) */ public void setCacheCapacity(int cacheCapacity) { this.cacheCapacity = cacheCapacity; } /** - * Public setter for the {@link CompletionPolicy} applying to the chunk level. A - * transaction will be committed when this policy decides to complete. Defaults to a - * {@link SimpleCompletionPolicy} with chunk size equal to the commitInterval + * Public setter for the {@link CompletionPolicy} that applies to the chunk level. A + * transaction is committed when this policy decides to complete. Defaults to a + * {@link SimpleCompletionPolicy} with chunk size equal to the {@code commitInterval} * property. - * @param chunkCompletionPolicy the chunkCompletionPolicy to set + * @param chunkCompletionPolicy The {@code chunkCompletionPolicy} to set. */ public void setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy) { this.chunkCompletionPolicy = chunkCompletionPolicy; } /** - * Set the commit interval. Either set this or the chunkCompletionPolicy but not both. + * Set the commit interval. Set either this or the {@code chunkCompletionPolicy} but + * not both. * @param commitInterval 1 by default */ public void setCommitInterval(int commitInterval) { @@ -928,8 +936,8 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Flag to signal that the reader is transactional (usually a JMS consumer) so that - * items are re-presented after a rollback. The default is false and readers are - * assumed to be forward-only. + * items are re-presented after a rollback. The default is {@code false}, and readers + * are assumed to be forward-only. * @param isReaderTransactionalQueue the value of the flag */ public void setIsReaderTransactionalQueue(boolean isReaderTransactionalQueue) { @@ -937,8 +945,8 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN } /** - * Flag to signal that the processor is transactional, in which case it should be - * called for every item in every transaction. If false then we can cache the + * Flag to signal that the processor is transactional -- in that case, it should be + * called for every item in every transaction. If {@code false}, we can cache the * processor results between transactions in the case of a rollback. * @param processorTransactional the value to set */ @@ -948,38 +956,38 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * Public setter for the retry limit. Each item can be retried up to this limit. Note - * this limit includes the initial attempt to process the item, therefore - * retryLimit == 1 by default. - * @param retryLimit the retry limit to set, must be greater or equal to 1. + * that this limit includes the initial attempt to process the item. Therefore, by + * default, retryLimit == 1. + * @param retryLimit The retry limit to set. Must be greater than or equal to 1. */ public void setRetryLimit(int retryLimit) { this.retryLimit = retryLimit; } /** - * Public setter for a limit that determines skip policy. If this value is positive - * then an exception in chunk processing will cause the item to be skipped and no - * exception propagated until the limit is reached. If it is zero then all exceptions - * will be propagated from the chunk and cause the step to abort. - * @param skipLimit the value to set. Default is 0 (never skip). + * Public setter for a limit that determines skip policy. If this value is positive, + * an exception in chunk processing causes the item to be skipped and no exception to + * be propagated until the limit is reached. If it is zero, all exceptions are + * propagated from the chunk and cause the step to abort. + * @param skipLimit The value to set. The default is 0 (never skip). */ public void setSkipLimit(int skipLimit) { this.skipLimit = skipLimit; } /** - * Public setter for a skip policy. If this value is set then the skip limit and - * skippable exceptions are ignored. - * @param skipPolicy the {@link SkipPolicy} to set + * Public setter for a skip policy. If this value is set, the skip limit and skippable + * exceptions are ignored. + * @param skipPolicy The {@link SkipPolicy} to set. */ public void setSkipPolicy(SkipPolicy skipPolicy) { this.skipPolicy = skipPolicy; } /** - * Public setter for the {@link TaskExecutor}. If this is set, then it will be used to - * execute the chunk processing inside the {@link Step}. - * @param taskExecutor the taskExecutor to set + * Public setter for the {@link TaskExecutor}. If this is set, it is used to execute + * the chunk processing inside the {@link Step}. + * @param taskExecutor The taskExecutor to set. */ public void setTaskExecutor(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; @@ -989,28 +997,28 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN * Public setter for the throttle limit. This limits the number of tasks queued for * concurrent processing to prevent thread pools from being overwhelmed. Defaults to * {@link TaskExecutorRepeatTemplate#DEFAULT_THROTTLE_LIMIT}. - * @param throttleLimit the throttle limit to set. + * @param throttleLimit The throttle limit to set. */ public void setThrottleLimit(Integer throttleLimit) { this.throttleLimit = throttleLimit; } /** - * @param itemReader the {@link ItemReader} to set + * @param itemReader The {@link ItemReader} to set. */ public void setItemReader(ItemReader itemReader) { this.itemReader = itemReader; } /** - * @param itemProcessor the {@link ItemProcessor} to set + * @param itemProcessor The {@link ItemProcessor} to set. */ public void setItemProcessor(ItemProcessor itemProcessor) { this.itemProcessor = itemProcessor; } /** - * @param itemWriter the {@link ItemWriter} to set + * @param itemWriter The {@link ItemWriter} to set. */ public void setItemWriter(ItemWriter itemWriter) { this.itemWriter = itemWriter; @@ -1021,27 +1029,28 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN // ========================================================= /** - * Public setter for the {@link RetryListener}s. - * @param retryListeners the {@link RetryListener}s to set + * Public setter for the {@link RetryListener} instances. + * @param retryListeners The {@link RetryListener} instances to set. */ public void setRetryListeners(RetryListener... retryListeners) { this.retryListeners = retryListeners; } /** - * Public setter for exception classes that when raised won't crash the job but will - * result in transaction rollback and the item which handling caused the exception - * will be skipped. - * @param exceptionClasses {@link Map} containing the {@link Throwable}s as the keys - * and the values are {@link Boolean}s, that if true the item is skipped. + * Public setter for exception classes that, when raised, do not crash the job but + * result in transaction rollback. The item for which handling caused the exception is + * skipped. + * @param exceptionClasses A {@link Map} containing the {@link Throwable} instances as + * the keys and the {@link Boolean} instances as the values. If {@code true}, the item + * is skipped. */ public void setSkippableExceptionClasses(Map, Boolean> exceptionClasses) { this.skippableExceptionClasses = exceptionClasses; } /** - * Public setter for exception classes that will retry the item when raised. - * @param retryableExceptionClasses the retryableExceptionClasses to set + * Public setter for exception classes that retries the item when raised. + * @param retryableExceptionClasses The retryableExceptionClasses to set. */ public void setRetryableExceptionClasses(Map, Boolean> retryableExceptionClasses) { this.retryableExceptionClasses = retryableExceptionClasses; @@ -1049,7 +1058,7 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN /** * The streams to inject into the {@link Step}. Any instance of {@link ItemStream} can - * be used, and will then receive callbacks at the appropriate stage in the step. + * be used, and it then receives callbacks at the appropriate stage in the step. * @param streams an array of listeners */ public void setStreams(ItemStream[] streams) { @@ -1061,28 +1070,28 @@ public class StepParserStepFactoryBean implements FactoryBean, BeanN // ========================================================= /** - * @param hasChunkElement true if step has <chunk/> element. + * @param hasChunkElement {@code true} if step has <chunk/> element. */ public void setHasChunkElement(boolean hasChunkElement) { this.hasChunkElement = hasChunkElement; } /** - * @return true if the defined step has a <chunk/> element + * @return {@code true} if the defined step has a <chunk/> element. */ protected boolean hasChunkElement() { return this.hasChunkElement; } /** - * @return true if the defined step has a <tasklet/> element + * @return {@code true} if the defined step has a <tasklet/> element. */ protected boolean hasTasklet() { return this.tasklet != null; } /** - * @return true if the defined step has a <partition/> element + * @return {@code true} if the defined step has a <partition/> element. */ protected boolean hasPartitionElement() { return this.partitionHandler != null; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java index 0ddaa3fb4..b7dc838eb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ public class TopLevelFlowParser extends AbstractFlowParser { private static final String ABSTRACT_ATTR = "abstract"; /** + * Parse the flow. * @param element the top level element containing a flow definition * @param parserContext the {@link ParserContext} */