ca.spaz.cron.config
Class AbstractRegexKeyValidator
java.lang.Object
ca.spaz.cron.config.AbstractRegexKeyValidator
- All Implemented Interfaces:
- PropertyValidator
- Direct Known Subclasses:
- CRONUser.UserPropertyValidator
public abstract class AbstractRegexKeyValidator
- extends java.lang.Object
- implements PropertyValidator
Method Summary |
protected abstract boolean |
doIsValid(java.lang.String key,
java.lang.String value)
This method will be called only in the case where the pattern matches. |
protected abstract java.lang.String |
getExpression()
Get the regular expression to match the key on. |
protected java.util.regex.Matcher |
getMatcher(java.lang.String string)
|
boolean |
isValid(java.lang.String key,
java.lang.String value)
Validate the specified value for the key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractRegexKeyValidator
public AbstractRegexKeyValidator()
getMatcher
protected java.util.regex.Matcher getMatcher(java.lang.String string)
isValid
public boolean isValid(java.lang.String key,
java.lang.String value)
- Description copied from interface:
PropertyValidator
- Validate the specified value for the key.
- Specified by:
isValid
in interface PropertyValidator
- Parameters:
key
- The property key to test.value
- The property value to test.
- Returns:
true
if the value is a valid one for the specified key,
false
otherwise.
doIsValid
protected abstract boolean doIsValid(java.lang.String key,
java.lang.String value)
- This method will be called only in the case where the pattern matches. This
can be assumed to be a precondition of the method call.
- Parameters:
key
- The matching key.value
- The value being checked.
- Returns:
true
if value
is a valid value for
key
, false
otherwise.
getExpression
protected abstract java.lang.String getExpression()
- Get the regular expression to match the key on.
- Returns:
- a string representation of a regular expression.
Copyright © 2005 Spaz. All Rights Reserved.