|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.validator.LengthValidator
org.apache.myfaces.trinidad.validator.LengthValidator
public class LengthValidator
Implementation for length of java.lang.String values.
| Field Summary | |
|---|---|
static java.lang.String |
EXACT_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the maximum and minimum lengths are the same,
and the length check fails, and both
the maximum and minimum values for this validator have been set. |
static java.lang.String |
MAXIMUM_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the maximum length check fails. |
static java.lang.String |
MINIMUM_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the minimum length check fails. |
static java.lang.String |
NOT_IN_RANGE_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the maximum or minimum length check fails, and both
the maximum and minimum lengths for this validator have been set. |
static java.lang.String |
VALIDATOR_ID
|
| Constructor Summary | |
|---|---|
LengthValidator()
Construct a Validator with no preconfigured limits. |
|
LengthValidator(int maximum)
Construct a Validator with the specified preconfigured
limit. |
|
LengthValidator(int maximum,
int minimum)
Construct a Validator with the specified preconfigured
limits. |
|
| Method Summary | |
|---|---|
java.lang.String |
getHintExact()
Return custom hint exact message. |
java.lang.String |
getHintMaximum()
Return custom hint maximum message. |
java.lang.String |
getHintMinimum()
Return custom hint minimum message. |
java.lang.String |
getHintNotInRange()
Return custom hint notInRange message. |
int |
getMaximum()
Return the maximum length to be enforced by this Validator or null if it has not been
set. |
java.lang.String |
getMessageDetailExact()
Return custom detail error message that was set for creating FacesMessage,
for cases where the maximum and minimum lengths are the same, and
the input length does not match. |
java.lang.String |
getMessageDetailMaximum()
Return custom detail error message that was set for creating FacesMessage,
for cases where input length exceeds the maximum length set. |
java.lang.String |
getMessageDetailMinimum()
Return custom detail error message that was set for creating FacesMessage,
for cases where, input length is less than the minimum length set. |
java.lang.String |
getMessageDetailNotInRange()
Return custom detail error message that was set for creating FacesMessage,
for cases where, input length exceeds the maximum length and is
less than the minimum length set. |
int |
getMinimum()
Return the minimum length to be enforced by this Validator, or null if it has not been
set. |
javax.faces.el.ValueBinding |
getValueBinding(java.lang.String name)
Return the ValueBinding used to calculate the value for the
specified attribute name, if any. |
protected boolean |
isMaximumSet()
|
protected boolean |
isMinimumSet()
|
boolean |
isTransient()
|
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setHintExact(java.lang.String hintExact)
Custom hint exact message. |
void |
setHintMaximum(java.lang.String hintMaximum)
Custom hint maximum message. |
void |
setHintMinimum(java.lang.String hintMinimum)
Custom hint minimum message. |
void |
setHintNotInRange(java.lang.String hintNotInRange)
Custom hint notInRange message. |
void |
setMaximum(int maximum)
Set the maximum length to be enforced by this Validator. |
void |
setMessageDetailExact(java.lang.String exactMessageDetail)
Custom error message to be used, for creating detail part of the FacesMessage,
for cases where the maximum and minimum lengths are the same, and
the input length does not match. |
void |
setMessageDetailMaximum(java.lang.String maximumMessageDetail)
Custom error message to be used, for creating detail part of the FacesMessage, when input length exceeds the maximum length set. |
void |
setMessageDetailMinimum(java.lang.String minimumMessageDetail)
Custom error message to be used, for creating detail part of the FacesMessage, when input length is less the set
minimum length. |
void |
setMessageDetailNotInRange(java.lang.String notInRangeMessageDetail)
Custom error message to be used, for creating detail part of the FacesMessage, when input length is not with in the range,
when minimum and maximum is set. |
void |
setMinimum(int minimum)
Set the minimum length to be enforced by this Validator. |
void |
setTransient(boolean transientValue)
|
void |
setValueBinding(java.lang.String name,
javax.faces.el.ValueBinding binding)
Set the ValueBinding used to calculate the value for the
specified attribute if any. |
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
|
| Methods inherited from class javax.faces.validator.LengthValidator |
|---|
equals |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VALIDATOR_ID
public static final java.lang.String MAXIMUM_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the maximum length check fails. The message format
string for this message may optionally include {0},
{1} and {3} placeholders,
which will be replaced by user input, component label and configured
maximum length.
public static final java.lang.String MINIMUM_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the minimum length check fails. The message format
string for this message may optionally include {0},
{1} and {2} placeholders, which will be replaced
by user input, component label and configured minimum length.
public static final java.lang.String NOT_IN_RANGE_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the maximum or minimum length check fails, and both
the maximum and minimum lengths for this validator have been set.
The message format string for this message may optionally include
{0}, {1}, {2} and {3}
placeholders, which will be replaced by user input, component label,
configured minimum length and configured maximum length.
public static final java.lang.String EXACT_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the maximum and minimum lengths are the same,
and the length check fails, and both
the maximum and minimum values for this validator have been set.
The message format string for this message may optionally include
{0}, {1}, {2}
placeholders, which will be replaced by user input, component label,
configured minimum/maximum length.
| Constructor Detail |
|---|
public LengthValidator()
Validator with no preconfigured limits.
public LengthValidator(int maximum)
Validator with the specified preconfigured
limit.
maximum - Maximum length to allow
public LengthValidator(int maximum,
int minimum)
Validator with the specified preconfigured
limits.
maximum - Maximum length to allowminimum - Minimum length to allow| Method Detail |
|---|
public int getMaximum()
Validator or null if it has not been
set.
getMaximum in class javax.faces.validator.LengthValidatorpublic void setMaximum(int maximum)
Validator.
setMaximum in class javax.faces.validator.LengthValidatormaximum - The new maximum lengthpublic int getMinimum()
Validator, or null if it has not been
set.
getMinimum in class javax.faces.validator.LengthValidatorpublic void setMinimum(int minimum)
Validator.
setMinimum in class javax.faces.validator.LengthValidatorminimum - The new minimum lengthpublic void setMessageDetailMaximum(java.lang.String maximumMessageDetail)
Custom error message to be used, for creating detail part of the
FacesMessage, when input length exceeds the maximum length set.
MAXIMUM_MESSAGE_ID
maximumMessageDetail - Custom error message.public java.lang.String getMessageDetailMaximum()
Return custom detail error message that was set for creating FacesMessage,
for cases where input length exceeds the maximum length set.
setMessageDetailMaximum(String)public void setMessageDetailMinimum(java.lang.String minimumMessageDetail)
Custom error message to be used, for creating detail part of the
FacesMessage, when input length is less the set
minimum length.
MINIMUM_MESSAGE_ID
minimumMessageDetail - Custom error message.public java.lang.String getMessageDetailMinimum()
Return custom detail error message that was set for creating FacesMessage,
for cases where, input length is less than the minimum length set.
setMessageDetailMinimum(String)public void setMessageDetailNotInRange(java.lang.String notInRangeMessageDetail)
Custom error message to be used, for creating detail part of the
FacesMessage, when input length is not with in the range,
when minimum and maximum is set.
NOT_IN_RANGE_MESSAGE_ID
notInRangeMessageDetail - Custom error message.public java.lang.String getMessageDetailNotInRange()
Return custom detail error message that was set for creating FacesMessage,
for cases where, input length exceeds the maximum length and is
less than the minimum length set.
setMessageDetailNotInRange(String)public void setMessageDetailExact(java.lang.String exactMessageDetail)
Custom error message to be used, for creating detail part of the
FacesMessage,
for cases where the maximum and minimum lengths are the same, and
the input length does not match.
Overrides detail message identified by message id EXACT_MESSAGE_ID
exactMessageDetail - Custom error message.public java.lang.String getMessageDetailExact()
Return custom detail error message that was set for creating FacesMessage,
for cases where the maximum and minimum lengths are the same, and
the input length does not match.
setMessageDetailExact(String)public void setHintMaximum(java.lang.String hintMaximum)
Custom hint maximum message.
Overrides default hint message
hintMaximum - Custom hint message.public java.lang.String getHintMaximum()
Return custom hint maximum message.
setHintMaximum(String)public void setHintMinimum(java.lang.String hintMinimum)
Custom hint minimum message.
Overrides default hint message
hintMinimum - Custom hint message.public java.lang.String getHintMinimum()
Return custom hint minimum message.
setHintMinimum(String)public void setHintNotInRange(java.lang.String hintNotInRange)
Custom hint notInRange message.
Overrides default hint message
hintNotInRange - Custom hint message.public java.lang.String getHintNotInRange()
Return custom hint notInRange message.
setHintNotInRange(java.lang.String)public void setHintExact(java.lang.String hintExact)
Custom hint exact message.
Overrides default hint message
hintExact - Custom hint message.public java.lang.String getHintExact()
Return custom hint exact message.
setHintExact(java.lang.String)
public void validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
throws javax.faces.validator.ValidatorException
validate in interface javax.faces.validator.Validatorvalidate in class javax.faces.validator.LengthValidatorjavax.faces.validator.ValidatorExceptionpublic java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.validator.LengthValidator
public void restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.validator.LengthValidator
public void setValueBinding(java.lang.String name,
javax.faces.el.ValueBinding binding)
Set the ValueBinding used to calculate the value for the
specified attribute if any.
name - Name of the attribute for which to set a ValueBindingbinding - The ValueBinding to set, or null
to remove any currently set ValueBinding
java.lang.NullPointerException - if name
is null
java.lang.IllegalArgumentException - if name is not a valid
attribute of this validatorpublic javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
Return the ValueBinding used to calculate the value for the
specified attribute name, if any.
name - Name of the attribute or property for which to retrieve a
ValueBinding
java.lang.NullPointerException - if name
is null
java.lang.IllegalArgumentException - if name is not a valid
attribute of this validatorpublic boolean isTransient()
isTransient in interface javax.faces.component.StateHolderisTransient in class javax.faces.validator.LengthValidatorpublic void setTransient(boolean transientValue)
setTransient in interface javax.faces.component.StateHoldersetTransient in class javax.faces.validator.LengthValidatorprotected boolean isMaximumSet()
protected boolean isMinimumSet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||