Class AbstractValidator<T>
java.lang.Object
ch.tocco.nice2.model.base.api.unmarshal.validate.AbstractValidator<T>
- All Implemented Interfaces:
Validator
- Direct Known Subclasses:
AbstractNumberValidator,LengthValidator,RegexValidator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringgetNegatedMessage(T value, String param) protected abstract StringgetNormalMessage(T value, String param) protected InvalidMappingExceptioninvalidMapping(String msg) protected InvalidMappingExceptioninvalidMapping(String msg, Throwable cause) Validate a value.protected abstract boolean
-
Constructor Details
-
AbstractValidator
protected AbstractValidator()
-
-
Method Details
-
validate
Description copied from interface:ValidatorValidate a value. The converted value will be passed to this method.- Specified by:
validatein 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
-