org.exolab.castor.xml.validators
Class PatternValidator
java.lang.Object
org.exolab.castor.xml.validators.PatternValidator
public abstract class PatternValidator
extends java.lang.Object
A simple abstract class used for validating types
which allow the pattern facet
$Revision: 5951 $ $Date: 2004-12-11 02:13:52 -0700 (Sat, 11 Dec 2004) $
PatternValidator() - Creates a new PatternValidator with no default
regular expression
|
PatternValidator(String pattern) - Creates a new PatternValidator with the given
regular expresion
|
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(String pattern) - Sets the regular expression to validate against
|
void | validate(Object object, ValidationContext context) - Validates the given Object
|
void | validate(String str, ValidationContext context) - Validates the given String against the regular expression pattern
of this PatternValidator.
|
PatternValidator
public PatternValidator()
Creates a new PatternValidator with no default
regular expression
PatternValidator
public PatternValidator(String pattern)
Creates a new PatternValidator with the given
regular expresion
pattern
- the regular expression to validate against
getPattern
public String getPattern()
Returns the regular expression pattern for this PatternValidator,
or null if no pattern has been set.
- the regular expression pattern
hasPattern
public boolean hasPattern()
Returns true if a regular expression has been set
for this PatternValidator
- true if a regular expression has been set
for this PatternValidator
isNillable
public boolean isNillable()
Returns whether or not objects validated by this
Validator are nillable (are allowed to be null).
- true if null is a valid value
setNillable
public void setNillable(boolean nillable)
Sets whether or not objects validated by this
Validator are allowed to be null (nillable).
nillable
- a boolean that when true indicates
null values pass validation
setPattern
public void setPattern(String pattern)
Sets the regular expression to validate against
pattern
- the regular expression to use when validating
validate
public void validate(Object object,
ValidationContext context)
throws ValidationException
Validates the given Object
object
- the Object to validatecontext
- the ValidationContext
validate
public void validate(String str,
ValidationContext context)
throws ValidationException
Validates the given String against the regular expression pattern
of this PatternValidator.
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com