V
- is the generic type of the value to validate
.public abstract class ValidatorTimeAfter<V> extends AbstractValueValidator<V>
ValueValidator
that
validates
that a date/time lies after
a given value.Modifier and Type | Field and Description |
---|---|
private V |
bound |
private AttributeReadValue<V> |
boundSource |
static String |
CODE |
PROPERTY_MANDATORY, PROPERTY_MAXIMUM, PROPERTY_MINIMUM
Constructor and Description |
---|
ValidatorTimeAfter(AttributeReadValue<V> valueSource)
The constructor.
|
ValidatorTimeAfter(V value)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
protected String |
getCode()
This is the default implementation to retrieve the
code of this
ValueValidator . |
int |
hashCode() |
protected abstract boolean |
isAfter(V value,
V limit) |
boolean |
isDynamic()
This method determines if this
ValueValidator is dynamic. |
protected NlsMessage |
validateNotNull(V value)
This method performs the validation in case
value is NOT null . |
validate, validateNull
append, contains, createBundle, getProperty, isMandatory, validate
public static final String CODE
getCode()
,
Constant Field Valuesprivate final AttributeReadValue<V> boundSource
private final V bound
public ValidatorTimeAfter(AttributeReadValue<V> valueSource)
valueSource
- the source
of the value to compare to.public ValidatorTimeAfter(V value)
value
- the value to compare to.public boolean isDynamic()
AbstractValidator
ValueValidator
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).isDynamic
in class AbstractValidator<V>
true
if this ValueValidator
is dynamic, false
otherwise.protected String getCode()
AbstractValidator
code
of this
ValueValidator
. classname
of the actual
ValueValidator
implementation. This strategy is chosen for simplicity when implementing a new validator. To
ensure stable codes override this method and return a string constant. This shall at least be done when the name of
the class is changed.getCode
in class AbstractValidator<V>
code
.protected NlsMessage validateNotNull(V value)
AbstractValueValidator
value
is NOT null
. 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. NlsMessage
instead.validateNotNull
in class AbstractValueValidator<V>
value
- is the value to validate.failure message
or null
if the the given value
is valid.protected abstract boolean isAfter(V value, V limit)
value
- the date to check.limit
- the upper bound to compare to.true
if value
is after limit
, false
otherwise.public int hashCode()
hashCode
in class AbstractValidator<V>
public boolean equals(Object obj)
equals
in class AbstractValidator<V>
Copyright © 2001–2016 mmm-Team. All rights reserved.