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.ValidatorException containing a
TYPE_MESSAGE_ID message.maximum and minimum property
has been configured on this Validator, check the component
value against both limits. If the component value is not within
this specified range, throw a ValidatorException containing a
NOT_IN_RANGE_MESSAGE_ID message.maximum property has been configured on this
Validator, check the component value against
this limit. If the component value is greater than the
specified maximum, throw a ValidatorException containing a
MAXIMUM_MESSAGE_ID message.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, throw a ValidatorException containing a
MINIMUM_MESSAGE_ID message.For all of the above cases that cause a ValidatorException
to be thrown, if there are parameters to the message that match up
with validator parameters, the values of these parameters must be
converted using the Converter registered in the application
under the converter id javax.faces.Number. This allows
the values to be localized according to the current
Locale.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Long | |
| public static final String | MAXIMUM_MESSAGE_ID
The message identifier of the |
| private Long | |
| public static final String | MINIMUM_MESSAGE_ID
The message identifier of the |
| public static final String | NOT_IN_RANGE_MESSAGE_ID
Hides javax. The message identifier of the |
| private boolean | |
| public static final String | TYPE_MESSAGE_ID
The message identifier of the |
| public static final String | VALIDATOR_ID
The standard converter id for this converter. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | LongRangeValidator(long
Maximum value to allow maximum)Construct a |
| public | LongRangeValidator(long
Maximum value to allow maximum, long Minimum value to allow minimum)Construct a |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearInitialState()
Implements javax. Reset the PartialStateHolder to a non-delta tracking state. |
| public boolean | equals(Object
the reference object with which to compare. otherObj)Overrides java. |
| public long | |
| public long | |
| public int | |
| public boolean | initialStateMarked()
Implements javax. Return |
| private boolean | |
| private boolean | |
| public boolean | isTransient()
Implements javax. If true, the Object implementing this interface must not participate in state saving or restoring. |
| private static long | |
| public void | markInitialState()
Implements javax. The runtime must ensure that the
|
| public void | restoreState(FacesContext
the Faces context. context, Object the state. state)Implements javax. Perform any processing required to restore the state from the entries in the state Object. |
| public Object | saveState(FacesContext
the Faces context. context)Implements javax. Gets the state of the instance as a
|
| public void | setMaximum(long
The new maximum value maximum)Set the maximum value to be enforced by this |
| public void | setMinimum(long
The new minimum value minimum)Set the minimum value to be enforced by this |
| public void | setTransient(boolean
boolean pass transientValue)true if this
Object will not
participate in state saving or restoring, otherwise pass
false.Implements javax. Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring. |
| private static String | |
| public void | validate(FacesContext
FacesContext for the request we are processing context, UIComponent UIComponent we are checking for correctness component, Object the value to validate value)Implements javax. Perform the
correctness checks implemented by this |
| initialState | back to summary |
|---|---|
| private boolean initialState | |
| maximum | back to summary |
|---|---|
| private Long maximum | |
| MAXIMUM_MESSAGE_ID | back to summary |
|---|---|
| public static final String MAXIMUM_MESSAGE_ID The message identifier of the
| |
| minimum | back to summary |
|---|---|
| private Long minimum | |
| MINIMUM_MESSAGE_ID | back to summary |
|---|---|
| public static final String MINIMUM_MESSAGE_ID The message identifier of the
| |
| NOT_IN_RANGE_MESSAGE_ID | back to summary |
|---|---|
| public static final String NOT_IN_RANGE_MESSAGE_ID Hides javax. The message identifier of the
| |
| transientValue | back to summary |
|---|---|
| private boolean transientValue | |
| TYPE_MESSAGE_ID | back to summary |
|---|---|
| public static final String TYPE_MESSAGE_ID The message identifier of the | |
| VALIDATOR_ID | back to summary |
|---|---|
| public static final String VALIDATOR_ID The standard converter id for this converter. | |
| LongRangeValidator | back to summary |
|---|---|
| public LongRangeValidator() Construct a | |
| LongRangeValidator | back to summary |
|---|---|
| public LongRangeValidator(long maximum) Construct a
| |
| LongRangeValidator | back to summary |
|---|---|
| public LongRangeValidator(long maximum, long minimum) Construct a
| |
| clearInitialState | back to summary |
|---|---|
| public void clearInitialState() Implements javax. Doc from javax. Reset the PartialStateHolder to a non-delta tracking state.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object otherObj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getMaximum | back to summary |
|---|---|
| public long getMaximum() Return the maximum value to be enforced by this
| |
| getMinimum | back to summary |
|---|---|
| public long getMinimum() Return the minimum value to be enforced by this
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initialStateMarked | back to summary |
|---|---|
| public boolean initialStateMarked() Implements javax. Doc from javax. Return
| |
| isMaximumSet | back to summary |
|---|---|
| private boolean isMaximumSet() | |
| isMinimumSet | back to summary |
|---|---|
| private boolean isMinimumSet() | |
| isTransient | back to summary |
|---|---|
| public boolean isTransient() Implements javax. Doc from javax. If true, the Object implementing this interface must not participate in state saving or restoring.
| |
| longValue | back to summary |
|---|---|
| private static long longValue(Object attributeValue) throws NumberFormatException Return the specified attribute value, converted to a
| |
| markInitialState | back to summary |
|---|---|
| public void markInitialState() Implements javax. Doc from javax. The runtime must ensure that the
| |
| restoreState | back to summary |
|---|---|
| public void restoreState(FacesContext context, Object state) Implements javax. Doc from javax. Perform any processing required to restore the state from the entries in the state Object. If the class that implements this interface has references to
instances that also implement StateHolder (such as a
If the
| |
| saveState | back to summary |
|---|---|
| public Object saveState(FacesContext context) Implements javax. Doc from javax. Gets the state of the instance as a
If the class that implements this interface has references to
instances that implement StateHolder (such as a
This method must not alter the state of the implementing object. In other words, after executing this code:
The return from this method must be
| |
| setMaximum | back to summary |
|---|---|
| public void setMaximum(long maximum) Set the maximum value to be enforced by this
| |
| setMinimum | back to summary |
|---|---|
| public void setMinimum(long minimum) Set the minimum value to be enforced by this
| |
| setTransient | back to summary |
|---|---|
| public void setTransient(boolean transientValue) Implements javax. Doc from javax. Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
| |
| stringValue | back to summary |
|---|---|
| private static String stringValue(UIComponent component, Long toConvert, FacesContext context) | |
| validate | back to summary |
|---|---|
| public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException Implements javax. Doc from javax. Perform the
correctness checks implemented by this For a validator to be fully compliant with Version 2 and later
of the specification, it must not fail validation on
| |