public class JobParametersBean
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean
JobParameters
for the Spring Bach Jobs. As input you pass in a JSON-based Map representation of
the parameters. Will use the DefaultJobParametersConverter
class underneath, allowing you to provide type
information.Constructor and Description |
---|
JobParametersBean(java.lang.String jobParametersAsJsonMap)
Initializes the
JobParametersBean . |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
org.springframework.batch.core.JobParameters |
getJobParameters()
Please ensure that
afterPropertiesSet() is called before obtaining the JobParameters . |
void |
setDateFormat(java.text.DateFormat dateFormat)
Will set the
DateFormat on the underlying DefaultJobParametersConverter . |
void |
setDateFormatAsString(java.lang.String dateFormat) |
void |
setMakeParametersUnique(boolean makeParametersUnique)
If not set, this property defaults to
true . |
void |
setNumberFormat(java.text.NumberFormat numberFormat)
Setter for the
NumberFormat which is set on the underlying DefaultJobParametersConverter . |
void |
setNumberFormatAsString(java.lang.String numberFormat) |
public JobParametersBean(java.lang.String jobParametersAsJsonMap)
JobParametersBean
.jobParametersAsJsonMap
- Can be null or empty. In that case the resulting JobParameters
will be
empty.public void setDateFormat(java.text.DateFormat dateFormat)
DateFormat
on the underlying DefaultJobParametersConverter
. If not set explicitly
the DateFormat
will default to "yyyy/MM/dd".dateFormat
- Must not be nullpublic void setDateFormatAsString(java.lang.String dateFormat)
public void setNumberFormat(java.text.NumberFormat numberFormat)
NumberFormat
which is set on the underlying DefaultJobParametersConverter
. If not
set explicitly, defaults to NumberFormat.getInstance(Locale.US);
numberFormat
- Must not be null.public void setNumberFormatAsString(java.lang.String numberFormat)
public void setMakeParametersUnique(boolean makeParametersUnique)
true
.makeParametersUnique
- public org.springframework.batch.core.JobParameters getJobParameters()
afterPropertiesSet()
is called before obtaining the JobParameters
.public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception