Package jakarta.faces.validator
Class DoubleRangeValidator
java.lang.Object
jakarta.faces.validator.DoubleRangeValidator
- All Implemented Interfaces:
PartialStateHolder
,StateHolder
,Validator
,EventListener
@JSFValidator(name="f:validateDoubleRange",
bodyContent="empty")
@JSFJspProperty(name="binding",
returnType="jakarta.faces.validator.DoubleRangeValidator",
longDesc="A ValueExpression that evaluates to a DoubleRangeValidator.")
public class DoubleRangeValidator
extends Object
implements Validator, PartialStateHolder
Creates a validator and associateds it with the nearest parent
UIComponent. When invoked, the validator ensures that values are
valid doubles that lie within the minimum and maximum values specified.
Commonly associated with a h:inputText entity.
Unless otherwise specified, all attributes accept static values or EL expressions.
see Javadoc of Faces Specification
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDoubleRangeValidator
(double maximum) DoubleRangeValidator
(double maximum, double minimum) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
double
The largest value that should be considered valid.double
The smallest value that should be considered valid.int
hashCode()
boolean
boolean
void
void
restoreState
(FacesContext context, Object state) saveState
(FacesContext context) void
setMaximum
(double maximum) void
setMinimum
(double minimum) void
setTransient
(boolean transientValue) void
validate
(FacesContext facesContext, UIComponent uiComponent, Object value)
-
Field Details
-
VALIDATOR_ID
- See Also:
-
MAXIMUM_MESSAGE_ID
- See Also:
-
MINIMUM_MESSAGE_ID
- See Also:
-
TYPE_MESSAGE_ID
- See Also:
-
NOT_IN_RANGE_MESSAGE_ID
- See Also:
-
-
Constructor Details
-
DoubleRangeValidator
public DoubleRangeValidator() -
DoubleRangeValidator
public DoubleRangeValidator(double maximum) -
DoubleRangeValidator
public DoubleRangeValidator(double maximum, double minimum)
-
-
Method Details
-
validate
public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException - Specified by:
validate
in interfaceValidator
- Throws:
ValidatorException
-
getMaximum
@JSFProperty(deferredValueType="java.lang.Double") public double getMaximum()The largest value that should be considered valid. -
setMaximum
public void setMaximum(double maximum) -
getMinimum
@JSFProperty(deferredValueType="java.lang.Double") public double getMinimum()The smallest value that should be considered valid. -
setMinimum
public void setMinimum(double minimum) -
saveState
- Specified by:
saveState
in interfaceStateHolder
-
restoreState
- Specified by:
restoreState
in interfaceStateHolder
-
isTransient
public boolean isTransient()- Specified by:
isTransient
in interfaceStateHolder
-
setTransient
public void setTransient(boolean transientValue) - Specified by:
setTransient
in interfaceStateHolder
-
equals
-
clearInitialState
public void clearInitialState()- Specified by:
clearInitialState
in interfacePartialStateHolder
-
initialStateMarked
public boolean initialStateMarked()- Specified by:
initialStateMarked
in interfacePartialStateHolder
-
markInitialState
public void markInitialState()- Specified by:
markInitialState
in interfacePartialStateHolder
-
hashCode
public int hashCode()
-