Package cdc.validation
Class ValidatorImpl<T>
- java.lang.Object
-
- cdc.validation.ValidatorImpl<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidatorImpl<?>createUnchecked(Checker<?> error, Checker<?> warning)StringexplainError(String name)Returns an explanation of the rule that must be respected to avoid errors.StringexplainWarning(String name)Returns an explanation of the rule that must be respected to avoid warnings.Checker<? super T>getChecker(Validity validity)Class<T>getValueClass()booleanhasChecker(Validity validity)StringtoString()voidvalidate(T value, String name, ValidationHandler handler)Validates a value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cdc.validation.Validator
after, after, afterRaw, getValidity, getValidityRaw, validate, validate, validateRaw, validateRaw, validateRaw
-
-
-
-
Method Detail
-
createUnchecked
public static ValidatorImpl<?> createUnchecked(Checker<?> error, Checker<?> warning)
-
getValueClass
public Class<T> getValueClass()
- Specified by:
getValueClassin interfaceValidator<T>- Returns:
- The class of values validated by this validator.
-
explainError
public String explainError(String name)
Description copied from interface:ValidatorReturns an explanation of the rule that must be respected to avoid errors.- Specified by:
explainErrorin interfaceValidator<T>- Parameters:
name- The name that must be given to value in messages.- Returns:
- An explanation of the rule that must be respected to avoid errors.
-
explainWarning
public String explainWarning(String name)
Description copied from interface:ValidatorReturns an explanation of the rule that must be respected to avoid warnings.- Specified by:
explainWarningin interfaceValidator<T>- Parameters:
name- The name that must be given to value in messages.- Returns:
- An explanation of the rule that must be respected to avoid warnings.
-
validate
public void validate(T value, String name, ValidationHandler handler)
Description copied from interface:ValidatorValidates a value.
-
hasChecker
public boolean hasChecker(Validity validity)
-
-