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
Version:
- Keith Visco
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
|
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
setPattern(String)
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
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
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com