org.exolab.castor.xml.validators
public abstract class PatternValidator extends Object
Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:52 $
Nested Class Summary | |
---|---|
class | PatternValidator.DefaultRegExpEvaluator
A simple implementation of a regular expression validator
which always returns false. |
Constructor Summary | |
---|---|
PatternValidator()
Creates a new PatternValidator with no default
regular expression
| |
PatternValidator(String pattern)
Creates a new PatternValidator with the given
regular expresion
|
Method Summary | |
---|---|
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
|
void | setPattern(String pattern)
Sets the regular expression to validate against |
void | validate(String str, ValidationContext context)
Validates the given String against the regular expression pattern
of this PatternValidator. |
void | validate(Object object, ValidationContext context)
Validates the given Object
|
Parameters: pattern the regular expression to validate against
Returns: the regular expression pattern
See Also: PatternValidator
Returns: true if a regular expression has been set for this PatternValidator
Parameters: pattern the regular expression to use when validating
Throws: ValidationException if the given String is not matched by the regular expression pattern
See Also: PatternValidator
Parameters: object the Object to validate context the ValidationContext