Hi all,
recently I built a constraint annotation that allows to use statements written in script languages such as Groovy for object validation (inspired by the
@Assert annotation of the OVal framework).
Using this annotation, constraints referring to multiple attributes of a bean can easily be expressed, as in the following example:
Code:
@ScriptAssert(lang = "groovy", script = "_this.startDate.before(_this.endDate)")
public class CalendarEvent {
private Date startDate;
private Date endDate;
//constructor, getters and setters ...
}
More information can be found in my web log at
http://musingsofaprogrammingaddict.blog ... ation.html. I'd be happy on any feedback, ideas for improvement etc.
Gunnar