|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.validators.PatternValidator
A simple abstract class used for validating types which allow the pattern facet
Nested Class Summary | |
(package private) 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(java.lang.String pattern)
Creates a new PatternValidator with the given regular expresion |
Method Summary | |
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 |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PatternValidator()
public PatternValidator(java.lang.String pattern)
pattern
- the regular expression to validate againstMethod Detail |
public java.lang.String getPattern()
setPattern(java.lang.String)
public boolean hasPattern()
public 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 ValidationContext
ValidationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |