Class AbstractValidator<T>
java.lang.Object
ch.tocco.nice2.model.base.unmarshal.validate.AbstractValidator<T>
- All Implemented Interfaces:
Validator
- Direct Known Subclasses:
AbstractNumberValidator
,LengthValidator
,RegexValidator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
getNegatedMessage
(T value, String param) protected abstract String
getNormalMessage
(T value, String param) protected InvalidMappingException
invalidMapping
(String msg) protected InvalidMappingException
invalidMapping
(String msg, Throwable cause) Validate a value.protected abstract boolean
-
Constructor Details
-
AbstractValidator
protected AbstractValidator()
-
-
Method Details
-
validate
Description copied from interface:Validator
Validate a value. The converted value will be passed to this method.- Specified by:
validate
in interfaceValidator
- Parameters:
value
- The value to be validated.param
- The parameter passed to the validator.msg
- The custom error message ornull
, if none was specified.negate
-true
, if the validation should be negated.- Returns:
- An error message (where '{1}' denotes where to put a description of the
element) or
null
, if the value is valid.
-
validate
-
getNormalMessage
-
getNegatedMessage
-
invalidMapping
-
invalidMapping
-