|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.faces.samples.carstore.FormatValidator
public class FormatValidator
FormatValidator is a Validator that checks the validity of String representation of the value of the associated component against a list of specified patterns.
null
, exit immediately. (If null values
should not be allowed, a RequiredValidator can be configured
to check for this case.)formatPattern
is a |
separated string
of allowed patterns.
Field Summary | |
---|---|
static String |
FORMAT_INVALID_MESSAGE_ID
The message identifier of the Message to be created if the validation fails. |
Fields inherited from interface javax.faces.validator.Validator |
---|
NOT_IN_RANGE_MESSAGE_ID |
Constructor Summary | |
---|---|
FormatValidator()
|
|
FormatValidator(String formatPatterns)
Construct a FormatValidator with the specified formatPatterns String. |
Method Summary | |
---|---|
String |
getFormatPatterns()
Return the format patterns that the validator supports. |
protected boolean |
isFormatValid(String pattern,
String value)
Returns true if the value matches one of the valid patterns. |
boolean |
isTransient()
|
void |
parseFormatPatterns()
Parses the formatPatterns into validPatterns
ArrayList . |
void |
restoreState(javax.faces.context.FacesContext context,
Object state)
|
Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setFormatPatterns(String formatPatterns)
Set the format patterns that the validator support.. |
void |
setTransient(boolean transientValue)
|
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object toValidate)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FORMAT_INVALID_MESSAGE_ID
The message identifier of the Message to be created if
the validation fails. The message format string for this
message may optionally include a {0}
placeholder, which
will be replaced by list of format patterns.
Constructor Detail |
---|
public FormatValidator()
public FormatValidator(String formatPatterns)
Construct a FormatValidator with the specified formatPatterns String.
formatPatterns
- |
separated String of format patterns
that this validator must match against.Method Detail |
---|
public String getFormatPatterns()
Return the format patterns that the validator supports.
public void setFormatPatterns(String formatPatterns)
Set the format patterns that the validator support..
formatPatterns
- |
separated String of format patterns
that this validator must match against.public void parseFormatPatterns()
formatPatterns
into validPatterns
ArrayList
. The delimiter must be "|".
public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object toValidate)
validate
in interface javax.faces.validator.Validator
protected boolean isFormatValid(String pattern, String value)
public Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
public void restoreState(javax.faces.context.FacesContext context, Object state)
restoreState
in interface javax.faces.component.StateHolder
public boolean isTransient()
isTransient
in interface javax.faces.component.StateHolder
public void setTransient(boolean transientValue)
setTransient
in interface javax.faces.component.StateHolder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |