D.9 Package javax.faces.validator
An instance of this class
is used as a
Validator for the range of a
Double value.
Synopsis
Class name:
|
javax.faces.validator.DoubleRangeValidator
|
Extends:
|
None
|
Implements:
|
javax.faces.convert.Validator,
javax.faces.component.StateHolder
|
Fields
- public static final String MAXIMUM_MESSAGE_ID
-
The message identifier for the message this validator creates if the
maximum value limit is exceeded:
javax.faces.validator.DoubleRangeValidator.MAXIMUM.
- public static final String MINIMUM_MESSAGE_ID
-
The message identifier for the message this validator creates if the
minimum value limit is not reached:
javax.faces.validator.DoubleRangeValidator.MINIMUM.
- public static final String TYPE_MESSAGE_ID
-
The message identifier for the message this validator creates if the
value is not of the correct type:
javax.faces.validator.DoubleRangeValidator.TYPE.
- public static final String VALIDATOR_ID
-
The identifier for this validator:
javax.faces.DoubleRange.
Constructors
- public DoubleRangeValidator()
-
Creates an instance.
- public DoubleRangeValidator(double maximum)
-
Creates an instance with the specified maximum.
- public DoubleRangeValidator(double maximum, double minimum)
-
Creates an instance with the specified maximum and minimum.
Methods
- public boolean equals(Object other)
-
Returns true if the other object represents the
same converter as this instance.
- public double getMaximum()
-
Returns the upper limit set or Double.MAX_VALUE if
not defined.
- public double getMinimum()
-
Returns the lower limit set or Double.MIN_VALUE if
not defined.
- public boolean isTransient()
-
Returns true if no state should be saved and
restored for this instance.
- public void restoreState(javax.faces.context.FacesContext context, Object state)
-
Restores the state for this instance from the provided value; an
Object previously returned by the
saveState() method.
- public Object saveState(javax.faces.context.FacesContext context)
-
Returns the state for this instance as an Object
to be passed to the restoreState() method when
the instance is restored for the next request.
- public void setMaximum(double maximum)
-
Sets the upper limit.
- public void setMinimum(double minimum)
-
Sets the lower limit.
- public void setTransient(boolean isTransient)
-
Sets the transient property value.
- public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
-
Validates the provided value to ensure it falls within the specified
limits. Throws a ValidatorException with an
instance of the appropriate FacesMessage if the
validation fails.
An instance of this
class is used as a
Validator for the length of a
String value.
Synopsis
Class name:
|
javax.faces.validator.LengthValidator
|
Extends:
|
None
|
Implements:
|
javax.faces.convert.Validator,
javax.faces.component.StateHolder
|
Fields
- public static final String MAXIMUM_MESSAGE_ID
-
The message identifier for the message this validator creates if the
maximum length limit is exceeded:
javax.faces.validator.LengthValidator.MAXIMUM.
- public static final String MINIMUM_MESSAGE_ID
-
The message identifier for the message this validator creates if the
minimum length limit is not reached:
javax.faces.validator.LengthValidator.MINIMUM.
- public static final String VALIDATOR_ID
-
The identifier for this validator:
javax.faces.Length.
Constructors
- public LengthValidator()
-
Creates an instance.
- public LengthValidator(int maximum)
-
Creates an instance with the specified maximum.
- public LengthValidator(int maximum, int minimum)
-
Creates an instance with the specified maximum and minimum.
Methods
- public boolean equals(Object other)
-
Returns true if the other object represents the
same converter as this instance.
- public int getMaximum()
-
Returns the upper limit set or zero if not defined.
- public int getMinimum()
-
Returns the lower limit set or zero if not defined.
- public boolean isTransient()
-
Returns true if no state should be saved and
restored for this instance.
- public void restoreState(javax.faces.context.FacesContext context, Object state)
-
Restores the state for this instance from the provided value; an
Object previously returned by the
saveState() method.
- public Object saveState(javax.faces.context.FacesContext context)
-
Returns the state for this instance as an Object
to be passed to the restoreState() method when
the instance is restored for the next request.
- public void setMaximum(int maximum)
-
Sets the upper limit.
- public void setMinimum(int minimum)
-
Sets the lower limit.
- public void setTransient(boolean isTransient)
-
Sets the transient property value.
- public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
-
Validates the provided value, to ensure it falls within the specified
limits. Throws a ValidatorException with an
instance of the appropriate FacesMessage if the
validation fails.
An instance of this class is used
as a
Validator for the range of a
Long value.
Synopsis
Class name:
|
javax.faces.validator.LongRangeValidator
|
Extends:
|
None
|
Implements:
|
javax.faces.convert.Validator,javax.faces.component.StateHolder
|
Fields
- public static final String MAXIMUM_MESSAGE_ID
-
The message identifier for the message this validator creates if the
maximum value limit is exceeded:
javax.faces.validator.LongRangeValidator.MAXIMUM.
- public static final String MINIMUM_MESSAGE_ID
-
The message identifier for the message this validator creates if the
minimum value limit is not reached:
javax.faces.validator.LongRangeValidator.MINIMUM.
- public static final String TYPE_MESSAGE_ID
-
The message identifier for the message this validator creates if the
value is not of the correct type:
javax.faces.validator.LongRangeValidator.TYPE.
- public static final String VALIDATOR_ID
-
The identifier for this validator:
javax.faces.LongRange.
Constructors
- public LongRangeValidator()
-
Creates an instance.
- public LongRangeValidator(int maximum)
-
Creates an instance with the specified maximum.
- public LongRangeValidator(int maximum, int minimum)
-
Creates an instance with the specified maximum and minimum.
Methods
- public boolean equals(Object other)
-
Returns true if the other object represents the
same converter as this instance.
- public int getMaximum()
-
Returns the upper limit set or Long.MAX_VALUE if
not defined.
- public int getMinimum()
-
Returns the lower limit set or Long.MIN_VALUE if
not defined.
- public boolean isTransient()
-
Returns true if no state should be saved and
restored for this instance.
- public void restoreState(javax.faces.context.FacesContext context, Object state)
-
Restores the state for this instance from the provided value; an
Object previously returned by the
saveState() method.
- public Object saveState(javax.faces.context.FacesContext context)
-
Returns the state for this instance as an Object
to be passed to the restoreState() method when
the instance is restored for the next request.
- public void setMaximum(int maximum)
-
Sets the upper limit.
- public void setMinimum(int minimum)
-
Sets the lower limit.
- public void setTransient(boolean isTransient)
-
Sets the transient property value.
- public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
-
Validates the provided value, to ensure it falls within the specified
limits. Throws a ValidatorException with an
instance of the appropriate FacesMessage if the
validation fails.
This interface is implemented
by all validator
classes.
Synopsis
Interface name:
|
javax.faces.validator.Validator
|
Extends:
|
None
|
Implemented by:
|
All standard and custom validators.
|
Fields
- public static final String NOT_IN_RANGE_MESSAGE_ID
-
The message identifier for the message a validator creates if the
value falls outside both the minimum and maximum value:
javax.faces.validator.NOT_IN_RANGE.
Methods
- public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
-
Validates the provided value. Throws a
ValidatorException with an instance of the
appropriate FacesMessage if the validation fails.
An instance of this class
is thrown by a
Validator implementation to signal a validation
error.
Synopsis
Class name:
|
javax.faces.validator.ValidatorException
|
Extends:
|
javax.faces.FacesException
|
Implements:
|
java.io.Serializable
|
Constructors
- public ValidatorException(java.faces.application.FacesMessage message)
-
Creates an instance with the specified message.
- public ValidatorException(java.faces.application.FacesMessage message,
- Throwable rootCause)
-
Creates an instance with the specified message and root cause.
Methods
- public java.faces.application.FacesMessage getFacesMessage()
-
Returns the FacesMessage instance, or
null if none is set.
|