T
- Date
, LocalDate
, LocalDateTime
, LocalTime
, OffsetDateTime
,
OffsetTime
@Component(value="cuba_FutureValidator") @Scope(value="prototype") public class FutureValidator<T> extends AbstractValidator<T>
Note, types that support TimeZones can be found in DateTimeTransformations.isDateTypeSupportsTimeZones(Class)
.
In order to provide your own implementation globally, create a subclass and register it in web-spring.xml
,
for example:
<bean id="cuba_FutureValidator" class="com.haulmont.cuba.gui.components.validation.FutureValidator" scope="prototype"/>Use
BeanLocator
when creating the validator programmatically.Modifier and Type | Field and Description |
---|---|
protected boolean |
checkSeconds |
static java.lang.String |
NAME |
datatypeRegistry, message, messages, userSessionSource
Constructor and Description |
---|
FutureValidator() |
FutureValidator(java.lang.String message)
Constructor for custom error message.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T value) |
boolean |
isCheckSeconds() |
void |
setCheckSeconds(boolean checkSeconds)
Set true if validator should also check seconds and nanos (if supported) in value.
|
protected void |
setMessages(Messages messages) |
formatValue, getMessage, getTemplateErrorMessage, setMessage
public static final java.lang.String NAME
protected boolean checkSeconds
public FutureValidator()
public FutureValidator(java.lang.String message)
message
- error message@Inject protected void setMessages(Messages messages)
public void setCheckSeconds(boolean checkSeconds)
checkSeconds
- check secondspublic boolean isCheckSeconds()
public void accept(T value) throws ValidationException
ValidationException