Package jakarta.faces.validator
Class LongRangeValidator
- java.lang.Object
-
- jakarta.faces.validator.LongRangeValidator
-
- All Implemented Interfaces:
PartialStateHolder
,StateHolder
,Validator
,EventListener
@JSFValidator(name="f:validateLongRange", bodyContent="empty") @JSFJspProperty(name="binding", returnType="jakarta.faces.validator.LongRangeValidator", longDesc="A ValueExpression that evaluates to a LongRangeValidator.") public class LongRangeValidator 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 longs 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
Fields Modifier and Type Field Description static String
MAXIMUM_MESSAGE_ID
static String
MINIMUM_MESSAGE_ID
static String
NOT_IN_RANGE_MESSAGE_ID
static String
TYPE_MESSAGE_ID
static String
VALIDATOR_ID
-
Constructor Summary
Constructors Constructor Description LongRangeValidator()
LongRangeValidator(long maximum)
LongRangeValidator(long maximum, long minimum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearInitialState()
boolean
equals(Object o)
long
getMaximum()
The largest value that should be considered valid.long
getMinimum()
The smallest value that should be considered valid.int
hashCode()
boolean
initialStateMarked()
boolean
isTransient()
void
markInitialState()
void
restoreState(FacesContext context, Object state)
Object
saveState(FacesContext context)
void
setMaximum(long maximum)
void
setMinimum(long minimum)
void
setTransient(boolean transientValue)
void
validate(FacesContext facesContext, UIComponent uiComponent, Object value)
-
-
-
Field Detail
-
MAXIMUM_MESSAGE_ID
public static final String MAXIMUM_MESSAGE_ID
- See Also:
- Constant Field Values
-
MINIMUM_MESSAGE_ID
public static final String MINIMUM_MESSAGE_ID
- See Also:
- Constant Field Values
-
TYPE_MESSAGE_ID
public static final String TYPE_MESSAGE_ID
- See Also:
- Constant Field Values
-
VALIDATOR_ID
public static final String VALIDATOR_ID
- See Also:
- Constant Field Values
-
NOT_IN_RANGE_MESSAGE_ID
public static final String NOT_IN_RANGE_MESSAGE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException
- Specified by:
validate
in interfaceValidator
- Throws:
ValidatorException
-
getMaximum
@JSFProperty(deferredValueType="java.lang.Long") public long getMaximum()
The largest value that should be considered valid.
-
setMaximum
public void setMaximum(long maximum)
-
getMinimum
@JSFProperty(deferredValueType="java.lang.Long") public long getMinimum()
The smallest value that should be considered valid.
-
setMinimum
public void setMinimum(long minimum)
-
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interfaceStateHolder
-
setTransient
public void setTransient(boolean transientValue)
- Specified by:
setTransient
in interfaceStateHolder
-
saveState
public Object saveState(FacesContext context)
- Specified by:
saveState
in interfaceStateHolder
-
restoreState
public void restoreState(FacesContext context, Object state)
- Specified by:
restoreState
in interfaceStateHolder
-
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
-
-