Skip to content

Multiple JobParameter validators [BATCH-1814] #1769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 15, 2011 · 2 comments
Closed

Multiple JobParameter validators [BATCH-1814] #1769

spring-projects-issues opened this issue Nov 15, 2011 · 2 comments

Comments

@spring-projects-issues
Copy link
Collaborator

Sloan Seaman opened BATCH-1814 and commented

Currently you can only define one Validator for JobParameters. It would be beneficial to be able to define multiple Validators like so:

<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:property name="lenient" value="false"/>
		</beans:bean>
	</beans:property>
</beans:bean>

This way you could add on to the validation of the parameters in a dynamic way instead of having to extend objects (such as the DefaultJobParametersValidator)


Affects: 2.1.8

Referenced from: commits c7ca71d

@spring-projects-issues
Copy link
Collaborator Author

Morten Andersen-Gott commented

#13

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

Merged thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant