|
||||||||||
| 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.RequiredValidator
RequiredValidator is a Validator that checks
for the existence of a value for the associated component. For the purposes
of this Validator, existence means a non-null value returned by calling
getValue(). In addition, if the component value is a String,
it must have a length greater than zero.
| Field Summary | |
static java.lang.String |
FAILED_MESSAGE_ID
The message identifier of the Message to be created if
this validation fails. |
| Constructor Summary | |
RequiredValidator()
|
|
| Method Summary | |
protected double |
doubleValue(java.lang.Object attributeValue)
Return the specified attribute value, converted to a double. |
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. |
protected long |
longValue(java.lang.Object attributeValue)
Return the specified attribute value, converted to a long. |
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 FAILED_MESSAGE_ID
The message identifier of the Message to be created if
this validation fails.
| Constructor Detail |
public RequiredValidator()
| Method Detail |
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 | |||||||||