org.apache.pivot.wtk.validation
Class RegexTextValidator
java.lang.Object
org.apache.pivot.wtk.validation.RegexTextValidator
- All Implemented Interfaces:
- Validator
public class RegexTextValidator
- extends Object
- implements Validator
A validator for a regular expression.
- See Also:
Pattern
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexTextValidator
public RegexTextValidator()
RegexTextValidator
public RegexTextValidator(Pattern p)
RegexTextValidator
public RegexTextValidator(String regexPattern)
getPattern
public Pattern getPattern()
setPattern
public void setPattern(Pattern pattern)
setPattern
public void setPattern(String regexPattern)
- Throws:
PatternSyntaxException
- If the expression's syntax is invalid
isValid
public boolean isValid(String text)
- Description copied from interface:
Validator
- Determines if a text value is valid based on the rules of the
validator.
- Specified by:
isValid
in interface Validator
- Returns:
- true if the value is valid; false, otherwise.