|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.validator.ValidatorBase
javax.faces.validator.LongRangeValidator
LongRangeValidator is a Validator that checks
the value of the corresponding component against specified minimum and
maximum values. The following algorithm is implemented:
null, exit immediately. (If null values
should not be allowed, a RequiredValidator can be configured
to check for this case.)FacesContext for this
request, and skip subsequent checks.maximum property has been configured on this
Validator, check the component value against
this limit. If the component value is greater than the
specified minimum, add a MAXIMUM_MESSAGE_ID message to the
FacesContext for this request.minimum property has been configured on this
Validator, check the component value against
this limit. If the component value is less than the
specified minimum, add a MINIMUM_MESSAGE_ID message to the
FacesContext for this request.
| Field Summary | |
static java.lang.String |
MAXIMUM_MESSAGE_ID
The message identifier of the Message to be created if
the maximum value check fails. |
static java.lang.String |
MINIMUM_MESSAGE_ID
The message identifier of the Message to be created if
the minimum value check fails. |
static java.lang.String |
TYPE_MESSAGE_ID
The message identifier of the Message to be created if
the current value of this component is not of the correct type. |
| Constructor Summary | |
LongRangeValidator()
Construct a Validator with no preconfigured limits. |
|
LongRangeValidator(long maximum)
Construct a Validator with the specified preconfigured
limit. |
|
LongRangeValidator(long maximum,
long minimum)
Construct a Validator with the specified preconfigured
limits. |
|
| Method Summary | |
protected double |
doubleValue(java.lang.Object attributeValue)
Return the specified attribute value, converted to a double. |
long |
getMaximum()
Return the maximum value to be enforced by this Validator,
if isMaximumSet() returns true. |
protected Message |
getMessage(FacesContext context,
java.lang.String messageId)
Return a Message for the specified parameters. |
protected Message |
getMessage(FacesContext context,
java.lang.String messageId,
java.lang.Object[] params)
Return a Message for the specified parameters. |
protected MessageResources |
getMessageResources()
Return the MessageResources instance for the message
resources defined by the JavaServer Faces Specification. |
long |
getMinimum()
Return the minimum value to be enforced by this Validator,
if isMinimumSet() returns true. |
boolean |
isMaximumSet()
Return a flag indicating whether a maximum limit has been set. |
boolean |
isMinimumSet()
Return a flag indicating whether a minimum limit has been set. |
protected long |
longValue(java.lang.Object attributeValue)
Return the specified attribute value, converted to a long. |
void |
setMaximum(long maximum)
Set the maximum value to be enforced by this Validator. |
void |
setMinimum(long minimum)
Set the minimum value to be enforced by this Validator. |
protected java.lang.String |
stringValue(java.lang.Object attributeValue)
Return the specified attribute value, converted to a String. |
void |
validate(FacesContext context,
UIComponent component)
Perform the correctness checks implemented by this Validator against the specified UIComponent. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String MAXIMUM_MESSAGE_ID
The message identifier of the Message to be created if
the maximum value check fails. The message format string for this
message may optionally include a {0} placeholder, which
will be replaced by the configured maximum value.
public static final java.lang.String MINIMUM_MESSAGE_ID
The message identifier of the Message to be created if
the minimum value check fails. The message format string for this
message may optionally include a {0} placeholder, which
will be replaced by the configured minimum value.
public static final java.lang.String TYPE_MESSAGE_ID
The message identifier of the Message to be created if
the current value of this component is not of the correct type.
| Constructor Detail |
public LongRangeValidator()
Construct a Validator with no preconfigured limits.
public LongRangeValidator(long maximum)
Construct a Validator with the specified preconfigured
limit.
maximum - Maximum value to allow
public LongRangeValidator(long maximum,
long minimum)
Construct a Validator with the specified preconfigured
limits.
maximum - Maximum value to allowminimum - Minimum value to allow
java.lang.IllegalArgumentException - if a specified maximum value is
less than a specified minimum value| Method Detail |
public long getMaximum()
Return the maximum value to be enforced by this Validator,
if isMaximumSet() returns true.
public void setMaximum(long maximum)
Set the maximum value to be enforced by this Validator.
maximum - The new maximum value
java.lang.IllegalArgumentException - if a specified maximum value is
less than a specified minimum valuepublic boolean isMaximumSet()
Return a flag indicating whether a maximum limit has been set.
public long getMinimum()
Return the minimum value to be enforced by this Validator,
if isMinimumSet() returns true.
public void setMinimum(long minimum)
Set the minimum value to be enforced by this Validator.
minimum - The new minimum value
java.lang.IllegalArgumentException - if a specified maximum value is
less than a specified minimum valuepublic boolean isMinimumSet()
Return a flag indicating whether a minimum limit has been set.
public void validate(FacesContext context,
UIComponent component)
ValidatorPerform the correctness checks implemented by this
Validator against the specified UIComponent.
If any violations are found:
Messages to the specified
FacesContext, specifying this UIComponent as
associated with the message, describing the nature of the
violation(s) encountered.valid property on the specified
UIComponent to false.
protected Message getMessage(FacesContext context,
java.lang.String messageId)
Return a Message for the specified parameters.
context - The FacesContext associated with the request
being processedmessageId - Message identifier of the requested message
protected Message getMessage(FacesContext context,
java.lang.String messageId,
java.lang.Object[] params)
Return a Message for the specified parameters.
context - The FacesContext associated with the request
being processedmessageId - Message identifier of the requested messageparams - Substitution parameters for this messageprotected MessageResources getMessageResources()
Return the MessageResources instance for the message
resources defined by the JavaServer Faces Specification.
protected double doubleValue(java.lang.Object attributeValue)
throws java.lang.NumberFormatException
Return the specified attribute value, converted to a
double.
attributeValue - The attribute value to be converted
java.lang.NumberFormatException - if conversion is not possible
protected long longValue(java.lang.Object attributeValue)
throws java.lang.NumberFormatException
Return the specified attribute value, converted to a
long.
attributeValue - The attribute value to be converted
java.lang.NumberFormatException - if conversion is not possibleprotected java.lang.String stringValue(java.lang.Object attributeValue)
Return the specified attribute value, converted to a
String.
attributeValue - The attribute value to be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||