java.lang.Object
io.github.mmm.validation.AbstractValidator<V>
io.github.mmm.validation.AbstractComposedValidator<V,V>
io.github.mmm.validation.ComposedValidator<V>
- Type Parameters:
V- is the generic type of the value tovalidate.
- All Implemented Interfaces:
Composable<Validator<?>>,Validator<V>,Iterable<Validator<?>>
Validator that is composed out of a set of individual validators given at
construction. It will always invoke all contained validators when a validation is performed.- Since:
- 1.0.0
-
Field Summary
FieldsFields inherited from class io.github.mmm.validation.AbstractComposedValidator
childrenFields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()AbstractValidatoronly provides a default implementation of this method.
ATTENTION:
This default implementation returns thesimple class nameof the actualValidatorimplementation.This method validates the givenvalue.Methods inherited from class io.github.mmm.validation.AbstractComposedValidator
append, append, containsId, equals, getChild, getChild, getChildCount, getRange, hashCode, validateChild, validateChildMethods inherited from class io.github.mmm.validation.AbstractValidator
isDynamic, source2string, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.base.lang.Composable
iteratorMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface io.github.mmm.validation.Validator
getMax, getMin, isMandatory, validate
-
Field Details
-
ID
- See Also:
-
-
Constructor Details
-
Method Details
-
getId
Description copied from class:AbstractValidatorAbstractValidatoronly provides a default implementation of this method.
ATTENTION:
This default implementation returns thesimple class nameof the actualValidatorimplementation. This strategy is chosen for simplicity when implementing a newValidator. To ensure stable IDs override this method and return a string constant. This shall at least be done when the name of the class is changed to provide backwards compatibility. -
validate
Description copied from interface:ValidatorThis method validates the givenvalue.- Parameters:
value- is the value to validate.valueSource- is thesourcedescribing the origin of the givenvalue. The source needs to have a reasonablestring-representationas this may be displayed to the end-user to locate the source of the failure. In most cases it is suitable to directly pass aString.- Returns:
- the
ValidationResult.
-