Class LocalDateRangeFieldValidator
java.lang.Object
org.apache.struts2.validator.validators.ValidatorSupport
org.apache.struts2.validator.validators.FieldValidatorSupport
org.apache.struts2.validator.validators.RangeValidatorSupport<LocalDate>
org.apache.struts2.validator.validators.LocalDateRangeFieldValidator
- All Implemented Interfaces:
FieldValidator,ShortCircuitableValidator,Validator
Field Validator that checks if a
LocalDate is within a specific range, both bounds inclusive.
Use DateRangeFieldValidator for a Date property.
- fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required
- min - the min date as an ISO date (yyyy-MM-dd). If not specified will not be checked.
- max - the max date as an ISO date (yyyy-MM-dd). If not specified will not be checked.
- minExpression - expression to calculate the minimum value (if none is specified, it will not be checked)
- maxExpression - expression to calculate the maximum value (if none is specified, it will not be checked)
<validators>
<field name="birthday">
<field-validator type="localdate">
<param name="min">1990-01-01</param>
<param name="max">2000-01-01</param>
<message>Birthday must be within ${min} and ${max}</message>
</field-validator>
</field>
<field name="birthday">
<field-validator type="localdate">
<param name="minExpression">${minValue}</param> <!-- will be evaluated as: LocalDate getMinValue() -->
<param name="maxExpression">${maxValue}</param> <!-- will be evaluated as: LocalDate getMaxValue() -->
<message>Birthday must be within ${min} and ${max}</message>
</field-validator>
</field>
</validators>
- Since:
- 7.5.0
-
Field Summary
Fields inherited from class org.apache.struts2.validator.validators.FieldValidatorSupport
currentValue, fieldNameFields inherited from class org.apache.struts2.validator.validators.ValidatorSupport
defaultMessage, EMPTY_STRING, messageKey, stack, textProviderFactory -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.struts2.validator.validators.RangeValidatorSupport
getMax, getMin, getT, setMax, setMaxExpression, setMin, setMinExpression, validate, validateValueMethods inherited from class org.apache.struts2.validator.validators.FieldValidatorSupport
getCurrentValue, getFieldName, getValidatorType, setFieldName, setValidatorTypeMethods inherited from class org.apache.struts2.validator.validators.ValidatorSupport
addActionError, addFieldError, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setTextProviderFactory, setValidatorContext, setValueStackMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.struts2.validator.Validator
getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext, setValueStack
-
Constructor Details
-
LocalDateRangeFieldValidator
public LocalDateRangeFieldValidator()
-