|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rave.web.ui.validator.StringLengthValidator
public class StringLengthValidator
Use this validator to check the number of characters in a string when you need to set the validation messages.
Field Summary | |
---|---|
static java.lang.String |
VALIDATOR_ID
The converter id for this converter. |
Fields inherited from interface javax.faces.validator.Validator |
---|
NOT_IN_RANGE_MESSAGE_ID |
Constructor Summary | |
---|---|
StringLengthValidator()
Creates a new instance of StringLengthValidator |
|
StringLengthValidator(int max)
Creates a new instance of StringLengthValidator. |
|
StringLengthValidator(int max,
int min)
Creates a new instance of StringLengthValidator. |
Method Summary | |
---|---|
java.lang.String |
getTooLongMessage()
Get the message to be used if the string is longer than the maxmimum number of characters. |
java.lang.String |
getTooShortMessage()
Get the message to be used if the string is shorter than the minimum number of characters. |
boolean |
isTransient()
Returns false, this component needs to save state. |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
Restore the state of the component. |
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
Saves the state of the component into an object |
void |
setTooLongMessage(java.lang.String tooLongMessage)
Set the message to be used if the string is longer than the maximum number of characters. |
void |
setTooShortMessage(java.lang.String tooShortMessage)
Set the message to be used if the string is shorter than the minimum number of characters. |
void |
setTransient(boolean transientValue)
Does nothing |
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
Validate the value with regard to a UIComponent and a
FacesContext . |
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 VALIDATOR_ID
The converter id for this converter.
Constructor Detail |
---|
public StringLengthValidator()
public StringLengthValidator(int max)
max
- The maximum number of characters allowed in the stringpublic StringLengthValidator(int max, int min)
max
- The maximum number of characters allowed in the stringmin
- The minimum number of characters allowed in the stringMethod Detail |
---|
public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value) throws javax.faces.validator.ValidatorException
Validate the value with regard to a UIComponent
and a
FacesContext
.
validate
in interface javax.faces.validator.Validator
context
- The FacesContextcomponent
- The component to be validatedvalue
- The submitted value of the component
javax.faces.validator.ValidatorException
- if the value is not validpublic java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
context
- the FacesContext
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
context
- The FacesContextstate
- the Object representing the state of the componentpublic boolean isTransient()
isTransient
in interface javax.faces.component.StateHolder
public void setTransient(boolean transientValue)
setTransient
in interface javax.faces.component.StateHolder
public java.lang.String getTooLongMessage()
public void setTooLongMessage(java.lang.String tooLongMessage)
tooLongMessage
- the message to be used if the string is longer than the maxmimum number of characterspublic java.lang.String getTooShortMessage()
public void setTooShortMessage(java.lang.String tooShortMessage)
tooShortMessage
- the message to be used if the string is shorter than the minimum number of characters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |