|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CheckExclusion
interface for classes that can exclude the checking of constraints
Method Summary | |
---|---|
String[] |
getProfiles()
|
String |
getWhen()
Formula returning true if this constraint shall be evaluated and
false if it shall be ignored for the current validation. |
boolean |
isActive(Object validatedObject,
Object valueToValidate,
Validator validator)
|
boolean |
isCheckExcluded(Check check,
Object validatedObject,
Object valueToValidate,
OValContext context,
Validator validator)
This method implements the validation logic |
void |
setProfiles(String... profiles)
|
void |
setWhen(String when)
Sets the formula returning true if this constraint shall be evaluated and
false if it shall be ignored for the current validation. |
Method Detail |
---|
String[] getProfiles()
String getWhen()
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)
boolean isActive(Object validatedObject, Object valueToValidate, Validator validator)
validatedObject
- the object/bean to validate the value against, for static fields or methods this is the classvalueToValidate
- the value to validate, may be null when validating pre conditions for static methodsvalidator
- the calling validator
true
if this check exclusion is active and must be satisfiedboolean isCheckExcluded(Check check, Object validatedObject, Object valueToValidate, OValContext context, Validator validator) throws OValException
check
- a check that OVal is about to validatevalidatedObject
- the object/bean to validate the value against, for static fields or methods this is
the classvalueToValidate
- the value to validate, may be null when validating pre conditions for static methodscontext
- the validation context (e.g. a field, a constructor parameter or a method parameter)validator
- the calling validator
OValException
void setProfiles(String... profiles)
profiles
- the profiles to setvoid setWhen(String when)
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)
when
- formula calculating if this check is active
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |