public final class LongValidator extends AbstractValidator implements javax.faces.component.StateHolder
Validator
implementation that will perform both format
and (optional) range checks on a Long value.
ARG_VALUE, helper, MAXIMUM_VALUE, MINIMUM_VALUE, SUBMITTED_VALUE
DEFAULT_RESOURCE_BUNDLE
Constructor and Description |
---|
LongValidator() |
Modifier and Type | Method and Description |
---|---|
long |
getMaximum()
Return the configured maximum value for this validator.
|
long |
getMinimum()
Return the configured minimum value for this validator.
|
void |
restoreState(javax.faces.context.FacesContext context,
Object state) |
Object |
saveState(javax.faces.context.FacesContext context) |
void |
setMaximum(long maximum)
Set the configured maximum value for this validator.
|
void |
setMinimum(long minimum)
Set the configured minimum value for this validator.
|
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object value)
Perform the correctness checks implemented by this
Validator against the specified UIComponent . |
actions, convert, isClient, resources, setClient, validate
getMessage, isTransient, message, message, message, setMessage, setTransient
public long getMaximum()
Return the configured maximum value for this validator.
public void setMaximum(long maximum)
Set the configured maximum value for this validator.
maximum
- The new maximum valuepublic long getMinimum()
Return the configured minimum value for this validator.
public void setMinimum(long minimum)
Set the configured minimum value for this validator.
minimum
- The new minimum valuepublic void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value) throws javax.faces.validator.ValidatorException
Perform the correctness checks implemented by this
Validator
against the specified UIComponent
.
If any violations are found, a ValidatorException
will be thrown containing the FacesMessage
describing the failure.
IMPLEMENTATION NOTE: Unlike earlier implementations of Shale Validator integration, validators that subclass this class do not support the option to skip server side validation.
validate
in interface javax.faces.validator.Validator
validate
in class AbstractValidator
context
- FacesContext
for the current requestcomponent
- UIComponent
we are checking for correctnessvalue
- The value to validatejavax.faces.validator.ValidatorException
- if validation failspublic void restoreState(javax.faces.context.FacesContext context, Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class AbstractValidator
public Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class AbstractValidator
Copyright © 2004-2013 Apache Software Foundation. All Rights Reserved.