Class JobStepBuilder
java.lang.Object
org.springframework.batch.core.step.builder.StepBuilderHelper<JobStepBuilder>
org.springframework.batch.core.step.builder.JobStepBuilder
A step builder for
JobStep instances. A job step executes a nested Job
with parameters taken from the parent job or from the step execution.- Since:
- 2.2
- Author:
- Dave Syer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
StepBuilderHelper.CommonStepProperties -
Field Summary
Fields inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties -
Constructor Summary
ConstructorsConstructorDescriptionJobStepBuilder(StepBuilderHelper<?> parent) Create a new builder initialized with any properties in the parent. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a step from the job provided.Provide a job to execute during the step.launcher(JobLauncher jobLauncher) Add a job launcher.parametersExtractor(JobParametersExtractor jobParametersExtractor) Provide a job parameters extractor.protected JobStepBuilderself()Methods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
allowStartIfComplete, enhance, getJobRepository, getName, isAllowStartIfComplete, listener, listener, meterRegistry, observationConvention, observationRegistry, repository, startLimit
-
Constructor Details
-
JobStepBuilder
Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.- Parameters:
parent- a parent helper containing common step properties
-
-
Method Details
-
job
Provide a job to execute during the step.- Parameters:
job- the job to execute- Returns:
- this for fluent chaining
-
launcher
Add a job launcher. Defaults to a simple job launcher.- Parameters:
jobLauncher- the job launcher to use- Returns:
- this for fluent chaining
-
parametersExtractor
Provide a job parameters extractor. Useful for extracting job parameters from the parent step execution context or job parameters.- Parameters:
jobParametersExtractor- the job parameters extractor to use- Returns:
- this for fluent chaining
-
build
Build a step from the job provided.- Returns:
- a new job step
-
self
- Specified by:
selfin classStepBuilderHelper<JobStepBuilder>
-