Announcement Announcement Module
Collapse
No announcement yet.
Multiple JobParameter validators Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    please open a JIRA Ticket

    Comment


    • #3
      Done! 1814 I believe...

      Comment

      Working...
      X