Class ScheduledJobParametersFactory
- java.lang.Object
- org.springframework.batch.core.launch.support.ScheduledJobParametersFactory
- All Implemented Interfaces:
JobParametersConverter
public class ScheduledJobParametersFactory extends java.lang.Object implements JobParametersConverter
- Author:
- Lucas Ward, Mahmoud Ben Hassine
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SCHEDULE_DATE_KEY
Constructor Summary
Constructors Constructor Description ScheduledJobParametersFactory()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobParameters
getJobParameters(java.util.Properties props)
Get a newJobParameters
instance.java.util.Properties
getProperties(JobParameters params)
Convert schedule date to Date, and assume all other parameters can be represented by their default string value.void
setDateFormat(java.text.DateFormat dateFormat)
Public setter for injecting a date format.
Field Detail
SCHEDULE_DATE_KEY
public static final java.lang.String SCHEDULE_DATE_KEY
- See Also:
- Constant Field Values
Method Detail
getJobParameters
public JobParameters getJobParameters(@Nullable java.util.Properties props)
Description copied from interface:JobParametersConverter
Get a newJobParameters
instance. If given null, or an empty properties, an empty JobParameters will be returned.- Specified by:
getJobParameters
in interfaceJobParametersConverter
- Parameters:
props
- the runtime parameters in the form of String literals.- Returns:
- a
JobParameters
properties converted to the correct types.
getProperties
public java.util.Properties getProperties(@Nullable JobParameters params)
Convert schedule date to Date, and assume all other parameters can be represented by their default string value.- Specified by:
getProperties
in interfaceJobParametersConverter
- Parameters:
params
- theJobParameters
instance to be converted.- Returns:
- a representation of the parameters as properties
- See Also:
JobParametersConverter.getProperties(org.springframework.batch.core.JobParameters)
setDateFormat
public void setDateFormat(java.text.DateFormat dateFormat)
Public setter for injecting a date format.- Parameters:
dateFormat
- aDateFormat
, defaults to "yyyy/MM/dd"