I'm curious why multiple job parameter validators are not allowed?
I want to validate that job parameters exists as well as them being a certain format. Why can't I do something like:
This way I could use the existing code and add additional format validation whenever I want.Code:<beans:bean class="org.springframework.batch.core.job.DefaultJobParametersValidator"> <beans:property name="requiredKeys"> <beans:list> <beans:value>someKey1</beans:value> <beans:value>someKey2</beans:value> </beans:list> </beans:property> </beans:bean> <beans:bean class="com.xxxxx.batch.validation.FormatJobParametersValidator"> <beans:property name="keys"> <beans:list> <beans:value>someKey1</beans:value> </beans:list> </beans:property> <beans:property name="format"> <beans:bean class="java.text.SimpleDateFormat"> <beans:constructor-arg value="yyyyMMdd"/> </beans:bean> </beans:property> </beans:bean>
I understand that I could extend the Default and add my format validation (which is what I will do to get around the existing limitation), but I'm curious why the above isn't supported.


Reply With Quote
