|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.adf.view.faces.validator.PatternValidator | +--oracle.adf.view.faces.validator.RegExpValidator
RegExpValidator is a Validator
that checks
the value of the corresponding component against specified pattern
using Java regular expression syntax.
The regular expression syntax accepted by the Validator
is
same as mentioned in class Pattern
in package
java.util.regex
. The following algorithm is implemented:
null
, exit immediately.ValidatorException
containing a TYPE_MESSAGE_ID message.ValidatorException
containing a INVALID_FORMAT_MESSAGE_ID messagepattern
property has been configured on this
Validator
, check the component value against this pattern.
If there is no matching pattern throw a ValidatorException
containing a NO_MATCH_MESSAGE_ID message.
Field Summary | |
static java.lang.String |
INVALID_FORMAT_MESSAGE_ID
The message identifier of the FacesMessage
to be created, if syntax of pattern is invalid. |
static java.lang.String |
NO_MATCH_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the match fails. |
static java.lang.String |
TYPE_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the current value of this component is not of the
correct type. |
static java.lang.String |
VALIDATOR_ID
Standard validator id for this validator. |
Fields inherited from interface javax.faces.validator.Validator |
NOT_IN_RANGE_MESSAGE_ID |
Constructor Summary | |
RegExpValidator()
Construct a Validator with no preconfigured pattern. |
|
RegExpValidator(java.lang.String pattern)
Construct a Validator with preconfigured pattern. |
Method Summary | |
void |
setPattern(java.lang.String pattern)
Set the pattern value to be enforced by this |
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
|
Methods inherited from class oracle.adf.view.faces.validator.PatternValidator |
equals, getPattern, hashCode, isTransient, restoreState, saveState, setTransient |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String VALIDATOR_ID
Standard validator id for this validator.
public static final java.lang.String INVALID_FORMAT_MESSAGE_ID
The message identifier of the FacesMessage
to be created, if syntax of pattern is invalid. The message format
string for this message may optionally include a {0}
placeholder, which will be replaced by the pattern that was set in
the validator.
public static final java.lang.String NO_MATCH_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the match fails. The message format
string for this message may optionally include a {0}
placeholder, which will be replaced by value that was set in input
component and {1}
which will be replaced by the pattern
set in the validator.
public static final java.lang.String TYPE_MESSAGE_ID
The message identifier of the FacesMessage
to be created if the current value of this component is not of the
correct type.
Constructor Detail |
public RegExpValidator()
Construct a Validator
with no preconfigured pattern.
public RegExpValidator(java.lang.String pattern)
Construct a Validator
with preconfigured pattern.
Method Detail |
public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value) throws javax.faces.validator.ValidatorException
javax.faces.validator.ValidatorException
- if validation fails
java.lang.NullPointerException
- if context
or component
or pattern
is null
public void setPattern(java.lang.String pattern)
Set the pattern value to be enforced by this Validator
setPattern
in class PatternValidator
pattern
- to be enforced.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |