java.lang.Object
io.github.mmm.validation.AbstractValidator<V>
- Type Parameters:
V
- is the generic type of the value tovalidate
.
- All Implemented Interfaces:
Composable<Validator<?>>
,Validator<V>
,Iterable<Validator<?>>
- Direct Known Subclasses:
AbstractComposedValidator
,AbstractValueValidator
This is the abstract base class all
Validator
implementations should extend.- Since:
- 1.0.0
-
Field Summary
Fields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Validator<?>
getChild
(int index) int
getId()
AbstractValidator
only provides a default implementation of this method.
ATTENTION:
This default implementation returns thesimple class name
of the actualValidator
implementation.int
hashCode()
boolean
This method determines if thisValidator
is dynamic.protected String
source2string
(Object source) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mmm.base.lang.Composable
iterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
AbstractValidator
public AbstractValidator()The constructor.
-
-
Method Details
-
getId
AbstractValidator
only provides a default implementation of this method.
ATTENTION:
This default implementation returns thesimple class name
of the actualValidator
implementation. 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. -
isDynamic
public boolean isDynamic()This method determines if thisValidator
is dynamic. Here dynamic means that the validation of the same input may not always return the same validation result (e.g. it holds references to instances that have dynamic impact on the validation).- Returns:
true
if thisValidator
is dynamic,false
otherwise.
-
getChildCount
public int getChildCount()- Specified by:
getChildCount
in interfaceComposable<V>
-
getChild
- Specified by:
getChild
in interfaceComposable<V>
-
source2string
- Parameters:
source
- thevalue source
.- Returns:
- the
string representation
of the givensource
.
-
hashCode
public int hashCode() -
equals
-
toString
-