public class DefaultJobParametersValidator extends Object implements JobParametersValidator, org.springframework.beans.factory.InitializingBean
JobParametersValidator.| Constructor and Description |
|---|
DefaultJobParametersValidator()
Convenient default constructor for unconstrained validation.
|
DefaultJobParametersValidator(String[] requiredKeys,
String[] optionalKeys)
Create a new validator with the required and optional job parameter keys
provided.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Check that there are no overlaps between required and optional keys.
|
void |
setOptionalKeys(String[] optionalKeys)
The keys that are optional in the parameters.
|
void |
setRequiredKeys(String[] requiredKeys)
The keys that are required in the parameters.
|
void |
validate(JobParameters parameters)
Check the parameters meet the specification provided.
|
public DefaultJobParametersValidator()
public DefaultJobParametersValidator(String[] requiredKeys, String[] optionalKeys)
requiredKeys - the required keysoptionalKeys - the optional keyssetOptionalKeys(String[]),
setRequiredKeys(String[])public void afterPropertiesSet()
throws IllegalStateException
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanIllegalStateException - if there is an overlappublic void validate(JobParameters parameters) throws JobParametersInvalidException
validate in interface JobParametersValidatorparameters - some JobParametersJobParametersInvalidException - if the parameters are not validJobParametersValidator.validate(JobParameters)public final void setRequiredKeys(String[] requiredKeys)
requiredKeys - the required key valuessetOptionalKeys(String[])public final void setOptionalKeys(String[] optionalKeys)
optionalKeys - the optional key valuessetRequiredKeys(String[])Copyright © 2013. All Rights Reserved.