Class FormattedValidator<F extends java.text.Format>

  • All Implemented Interfaces:
    Validator
    Direct Known Subclasses:
    DecimalValidator

    public class FormattedValidator<F extends java.text.Format>
    extends java.lang.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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected F format  
      protected 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • format

        protected final F extends java.text.Format format
      • locale

        protected final java.util.Locale locale
    • Constructor Detail

      • FormattedValidator

        public FormattedValidator​(F format)
      • FormattedValidator

        public FormattedValidator​(F format,
                                  java.util.Locale locale)
    • 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 interface Validator
        Parameters:
        text - The text to test.
        Returns:
        true if the value is valid; false, otherwise.