Package io.github.mmm.validation.string
Class ValidatorEmailSpec
- java.lang.Object
-
- io.github.mmm.validation.AbstractValidator<V>
-
- io.github.mmm.validation.AbstractValueValidator<CharSequence>
-
- io.github.mmm.validation.string.ValidatorEmailSpec
-
- All Implemented Interfaces:
Composable<Validator<?>>
,Validator<CharSequence>
,Iterable<Validator<?>>
public final class ValidatorEmailSpec extends AbstractValueValidator<CharSequence>
Validator
validating
that a givenCharSequence
is a valid email address specification (a raw email without display name, comments, etc.).- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID
-
Fields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidatorEmailSpec
get()
String
getId()
AbstractValidator
only provides a default implementation of this method.
ATTENTION:
This default implementation returns thesimple class name
of the actualValidator
implementation.protected NlsMessage
validateNotNull(CharSequence value)
This method performs the validation in casevalue
is NOTnull
.-
Methods inherited from class io.github.mmm.validation.AbstractValueValidator
validate, validateNull
-
Methods inherited from class io.github.mmm.validation.AbstractValidator
equals, hashCode, isDynamic, source2string, 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
getChild, getChildCount, iterator
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface io.github.mmm.validation.Validator
append, append, containsId, getMax, getMin, isMandatory, validate
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
getId()
, Constant Field Values
-
-
Method Detail
-
getId
public String getId()
Description copied from class:AbstractValidator
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.- Specified by:
getId
in interfaceValidator<CharSequence>
- Overrides:
getId
in classAbstractValidator<CharSequence>
- Returns:
- the identifier of this
Validator
. - See Also:
ValidationResult.getCode()
-
validateNotNull
protected NlsMessage validateNotNull(CharSequence value)
Description copied from class:AbstractValueValidator
This method performs the validation in casevalue
is NOTnull
. This method contains the actual custom logic for the validation. It is therefore designed in a way that makes it most simple to implement custom validators.- Specified by:
validateNotNull
in classAbstractValueValidator<CharSequence>
- Parameters:
value
- the value to validate.- Returns:
- the
failure message
ornull
if the the givenvalue
is valid.
-
get
public static ValidatorEmailSpec get()
- Returns:
- the instance of
ValidatorEmailSpec
.
-
-