| net.sf.oval.Check
All known Subclasses: net.sf.oval.AbstractCheck,
Check | public interface Check extends Serializable(Code) | | interface for classes that can check/validate if a constraint is satisfied
author: Sebastian Thomschke |
getErrorCode | String getErrorCode()(Code) | | the error code that will be used in a corresponding ConstraintViolation object |
getMessage | String getMessage()(Code) | | gets the default message that is displayed if a corresponding message key
is not found in the messages properties file
default processed place holders are:
- {context} => specifies which getter, method parameter or field was validated
- {invalidValue} => string representation of the validated value
|
getMessageVariables | Map<String, String> getMessageVariables()(Code) | | values that are used to fill place holders when rendering the error message.
A key "min" with a value "4" will replace the place holder {min} in an error message
like "Value cannot be smaller than {min}" with the string "4".
|
getProfiles | String[] getProfiles()(Code) | | the profiles, may return null |
getSeverity | int getSeverity()(Code) | | the severity |
isSatisfied | boolean isSatisfied(Object validatedObject, Object valueToValidate, OValContext context, Validator validator) throws OValException(Code) | | This method implements the validation logic
Parameters: validatedObject - the object/bean to validate the value against, for static fields or methods this is the class Parameters: valueToValidate - the value to validate, may be null when validating pre conditions for static methods Parameters: context - the validation context (e.g. a field, a constructor parameter or a method parameter) Parameters: validator - the calling validator true if the value satisfies the checked constraint |
setErrorCode | void setErrorCode(String errorCode)(Code) | | Parameters: errorCode - the error code to set |
setMessage | void setMessage(String message)(Code) | | sets the default message that is displayed if a corresponding message key
is not found in the messages properties file
default processed place holders are:
- {context} => specifies which getter, method parameter or field was validated
- {invalidValue} => string representation of the validated value
|
setProfiles | void setProfiles(String... profiles)(Code) | | Parameters: profiles - the profiles to set |
setSeverity | void setSeverity(int severity)(Code) | | Parameters: severity - the severity to set |
|
|