[
http://opensource.atlassian.com/projects/hibernate/browse/HV-38?page=com....
]
Bruno Braga commented on HV-38:
-------------------------------
Already I created patch with Support Conditional Validation.
Example of use:
public Boolean isReceiveNews() {
return receiveNews;
}
@NotNull(applyIf="value.receiveNews == true")
public String getAdress() {
return adress;
}
@NotNull(applyIf="value.receiveNews == true")
public String getTelephone() {
return telephone;
}
....
obs.:
The DefaultMessageInterpolator class, already created one annotationParameters (making
loop in annotation). I used it to get the value of applyIf.
This is not most correct (for responsibility).
You can modify the name of DefaultMessageInterpolator and
DefaultMessageInterpolatorAggerator or you suggest some refactoring.
A suggestion would be to consider one refactoring (extract the loop of annotation of the
DefaultMessageInterpolator). If to change the name for DefaultParameterInterpolation,
applyIf does not have interpolation..., but it is an option also.
Conditional validation
----------------------
Key: HV-38
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-38
Project: Hibernate Validator
Issue Type: Improvement
Components: engine
Affects Versions: 3.0.0.ga
Reporter: Bruno Braga
Priority: Critical
Attachments: commons-jexl-1.1.jar, hibernate-validator.jar, patch.txt
Support Conditional Validation
Example:
@NotNull(apply-if="some condition in el")
I can develop this if you approve.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira