net.sf.oval.constraint
Annotation Type AssertConstraintSet


@Documented
@Retention(value=RUNTIME)
@Target(value={FIELD,PARAMETER,METHOD})
@Constraint(checkWith=AssertConstraintSetCheck.class)
public @interface AssertConstraintSet

Check if the value satisfies the all constraints of specified constraint set.

Author:
Sebastian Thomschke

Required Element Summary
 String id
          The id of the constraint set to apply here
 
Optional Element Summary
 ConstraintTarget[] appliesTo
          In case the constraint is declared for an array, collection or map this controls how the constraint is applied to it and it's child objects.
 String[] profiles
          The associated constraint profiles.
 String when
          Formula returning true if this constraint shall be evaluated and false if it shall be ignored for the current validation.
 

Element Detail

id

public abstract String id
The id of the constraint set to apply here

appliesTo

public abstract ConstraintTarget[] appliesTo

In case the constraint is declared for an array, collection or map this controls how the constraint is applied to it and it's child objects.

Default: ConstraintTarget.CONTAINER

Note: This setting is ignored for object types other than array, map and collection.

Default:
CONTAINER

profiles

public abstract String[] profiles
The associated constraint profiles.

Default:
{}

when

public abstract String when
Formula returning true if this constraint shall be evaluated and false if it shall be ignored for the current validation.

Important: The formula must be prefixed with the name of the scripting language that is used. E.g. groovy:_this.amount > 10

Available context variables are:
_this -> the validated bean
_value -> the value to validate (e.g. the field value, parameter value, method return value, or the validated bean for object level constraints)

Default:
""


Copyright © 2005–2015 The OVal Development Team. All rights reserved.