Issue Type: New Feature New Feature
Affects Versions: 5.0.0.Beta1
Assignee: Unassigned
Components: engine
Created: 17/Feb/13 6:36 AM
Description:

@ScriptAssert should be allowed to be used as cross-parameter constraint.

Maybe we should also provide a dedicated constraint which makes the intention clearer and e.g. uses args as alias:

@ParametersAssert(script="args[0] == args[1]", lang="javascript")
public void resetPassword(String password, String repeated) { ... }

with

@Target({ METHOD, CONSTRUCTOR })
@Retention(RUNTIME)
@Constraint(validatedBy = {})
@Documented
@ScriptAssert(lang = "", script = "", alias = "args", validationAppliesTo = PARAMETERS)
public @interface ParametersAssert {

    String message() default "{org.hibernate.validator.constraints.ParametersAssert.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    @OverridesAttribute(constraint = ScriptAssert.class, name = "script")
    String script();

    @OverridesAttribute(constraint = ScriptAssert.class, name = "lang")
    String lang();
}
Fix Versions: 5.0.0.Final
Project: Hibernate Validator
Priority: Major Major
Reporter: Gunnar Morling
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira