Class DefaultJobParametersExtractor
java.lang.Object
org.springframework.batch.core.step.job.DefaultJobParametersExtractor
- All Implemented Interfaces:
JobParametersExtractor
Simple implementation of
JobParametersExtractor which pulls parameters with
named keys out of the step execution context and the job parameters of the surrounding
job.- Author:
- Dave Syer, Will Schipp, Mahmoud Ben Hassine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetJobParameters(Job job, StepExecution stepExecution) Extract job parameters from the step execution, for example from the execution context or other properties.voidsetJobParametersConverter(JobParametersConverter jobParametersConverter) Set theJobParametersConverterto use.voidThe key names to pull out of the execution context or job parameters, if they exist.voidsetUseAllParentParameters(boolean useAllParentParameters) setter to support switching off all parent parameters
-
Constructor Details
-
DefaultJobParametersExtractor
public DefaultJobParametersExtractor()
-
-
Method Details
-
setKeys
The key names to pull out of the execution context or job parameters, if they exist. If a key doesn't exist in the execution context then the job parameters from the enclosing job execution are tried, and if there is nothing there either then no parameter is extracted.- Parameters:
keys- the keys to set
-
getJobParameters
Description copied from interface:JobParametersExtractorExtract job parameters from the step execution, for example from the execution context or other properties.- Specified by:
getJobParametersin interfaceJobParametersExtractor- Parameters:
job- aJobstepExecution- aStepExecution- Returns:
- some
JobParameters - See Also:
-
setUseAllParentParameters
public void setUseAllParentParameters(boolean useAllParentParameters) setter to support switching off all parent parameters- Parameters:
useAllParentParameters- if false do not include parent parameters. True if all parent parameters need to be included.
-
setJobParametersConverter
Set theJobParametersConverterto use.- Parameters:
jobParametersConverter- the converter to use. Must not benull.
-