You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org> on 2009/11/13 23:26:39 UTC
[jira] Resolved: (EXTVAL-70) dependency injection for jsr 303
constraint-validators
[ https://issues.apache.org/jira/browse/EXTVAL-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gerhard Petracek resolved EXTVAL-70.
------------------------------------
Resolution: Fixed
Fix Version/s: 1.1.3-SNAPSHOT
2.0.3-SNAPSHOT
1.2.3-SNAPSHOT
> dependency injection for jsr 303 constraint-validators
> ------------------------------------------------------
>
> Key: EXTVAL-70
> URL: https://issues.apache.org/jira/browse/EXTVAL-70
> Project: MyFaces Extensions Validator
> Issue Type: New Feature
> Components: Bean Validation
> Affects Versions: 1.2.3-SNAPSHOT, 2.0.3-SNAPSHOT, 1.1.3-SNAPSHOT
> Reporter: Gerhard Petracek
> Fix For: 1.2.3-SNAPSHOT, 2.0.3-SNAPSHOT, 1.1.3-SNAPSHOT
>
>
> it should be possible to provide/override constraint-validators via bean(s) provided by a bean-management facility/dependency injection provider e.g. to allow to inject services into constraint-validators.
> the minimal version of a bv-constraint is:
> @Constraint(validatedBy = { CustomValidator.class })
> @Target({ METHOD, FIELD, ANNOTATION_TYPE /*...*/})
> @Retention(RUNTIME)
> public @interface CustomNotEmpty
> {
> String message() default "default message";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> }
> validatedBy is required as well. the mechanism should use the class name of the constraint-validator to get the bean name (in this case: the bean name is: customValidator)
> if a bean with this name is available and it is a constraint validator, the found bean should be used instead of a plain instance of the found class.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.