Results 1 to 3 of 3

Thread: Multiple JobParameter validators

  1. #1
    Join Date
    Jan 2011
    Posts
    14

    Default Multiple JobParameter validators

    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:
    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>
    This way I could use the existing code and add additional format validation whenever I want.

    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.

  2. #2

  3. #3
    Join Date
    Jan 2011
    Posts
    14

    Default

    Done! 1814 I believe...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •