public abstract class PatternValidator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
PatternValidator.DefaultRegExpEvaluator
A simple implementation of a regular expression validator
which always returns false.
|
| Constructor and Description |
|---|
PatternValidator()
Creates a new PatternValidator with no default
regular expression
|
PatternValidator(java.lang.String pattern)
Creates a new PatternValidator with the given
regular expresion
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPattern()
Returns the regular expression pattern for this PatternValidator,
or null if no pattern has been set.
|
boolean |
hasPattern()
Returns true if a regular expression has been set
for this PatternValidator
|
boolean |
isNillable()
Returns whether or not objects validated by this
Validator are nillable (are allowed to be null).
|
void |
setNillable(boolean nillable)
Sets whether or not objects validated by this
Validator are allowed to be null (nillable).
|
void |
setPattern(java.lang.String pattern)
Sets the regular expression to validate against
|
void |
validate(java.lang.Object object,
ValidationContext context)
Validates the given Object
|
void |
validate(java.lang.String str,
ValidationContext context)
Validates the given String against the regular expression pattern
of this PatternValidator.
|
public PatternValidator()
public PatternValidator(java.lang.String pattern)
pattern - the regular expression to validate againstpublic java.lang.String getPattern()
setPattern(java.lang.String)public boolean isNillable()
public boolean hasPattern()
public void setNillable(boolean nillable)
nillable - a boolean that when true indicates
null values pass validationpublic void setPattern(java.lang.String pattern)
pattern - the regular expression to use when validatingpublic void validate(java.lang.String str,
ValidationContext context)
throws ValidationException
ValidationException - if the given String is not
matched by the regular expression patternsetPattern(java.lang.String)public void validate(java.lang.Object object,
ValidationContext context)
throws ValidationException
object - the Object to validatecontext - the ValidationContextValidationExceptionIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com