Package org.apache.pivot.wtk.validation
Class ComparableValidator<T extends java.lang.Comparable<T>>
- java.lang.Object
-
- org.apache.pivot.wtk.validation.FormattedValidator<java.text.NumberFormat>
-
- org.apache.pivot.wtk.validation.DecimalValidator
-
- org.apache.pivot.wtk.validation.ComparableValidator<T>
-
- All Implemented Interfaces:
Validator
- Direct Known Subclasses:
BigDecimalValidator
,BigIntegerValidator
,ComparableRangeValidator
public class ComparableValidator<T extends java.lang.Comparable<T>> extends DecimalValidator
A validator for a Comparable value.
-
-
Field Summary
-
Fields inherited from class org.apache.pivot.wtk.validation.FormattedValidator
format, locale
-
-
Constructor Summary
Constructors Constructor Description ComparableValidator()
ComparableValidator(java.util.Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid(java.lang.String text)
Determines if a text value is valid based on the rules of the validator.protected java.lang.Comparable<?>
textToComparable(java.lang.String text)
-
Methods inherited from class org.apache.pivot.wtk.validation.DecimalValidator
isAutoTrim, parseNumber, setAutoTrim, textToBigDecimal
-
-
-
-
Method Detail
-
isValid
public boolean isValid(java.lang.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 interfaceValidator
- Overrides:
isValid
in classFormattedValidator<java.text.NumberFormat>
- Parameters:
text
- The text to test.- Returns:
true
if the value is valid;false
, otherwise.
-
textToComparable
protected final java.lang.Comparable<?> textToComparable(java.lang.String text)
-
-