org.apache.pivot.wtk.validation
Class FormattedValidator<F extends Format>
java.lang.Object
org.apache.pivot.wtk.validation.FormattedValidator<F>
- All Implemented Interfaces:
- Validator
- Direct Known Subclasses:
- DecimalValidator
public class FormattedValidator<F extends Format>
- extends Object
- implements Validator
A validator for a Format
'ed value.
This class is mostly intended to be a base-class for other validators.
Subclasses will set a different Format
object, which
will be used in the isValid(java.lang.String)
method of this base class to do the
validation.
Method Summary |
boolean |
isValid(String text)
Determines if a text value is valid based on the rules of the
validator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
format
protected final F extends Format format
locale
protected final Locale locale
FormattedValidator
public FormattedValidator(F format)
FormattedValidator
public FormattedValidator(F format,
Locale locale)
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.