de.esprit.appsuite.database.dbgui.field

## Class InputValidator

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.database.dbgui.field.InputValidator

- All Implemented Interfaces:
    Dumpable

      public class InputValidator
      extends DumpableObject

  This class encapsulates the functionality for checking the validity of field input. Its a central place to define what values are valid for what fields. All fields will request this class when they check the validity of their input with the isInputValid() method.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InputValidator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkExcludedValue(Field field, java.lang.Object value, java.lang.Object exclValue)`
    `void` | `checkFieldInput(Field field)`
    `protected void` | `checkMaxValue(Field field, java.util.Date value, java.util.Date maxValue)`
    `protected void` | `checkMaxValue(Field field, double value, double maxValue)`
    `protected void` | `checkMinValue(Field field, java.util.Date value, java.util.Date minValue)`
    `protected void` | `checkMinValue(Field field, double value, double minValue)`
    `protected void` | `checkRange(Field field, java.util.Date value, java.util.Date minValue, java.util.Date maxValue)`
    `protected void` | `checkRange(Field field, double value, double minValue, double maxValue)`
    `static InputValidator` | `getInstance()`
    `boolean` | `isEnabled()`
    `protected boolean` | `isUncheckedField(Field field)` Tells whether the field needs input checking.
    `void` | `put(Field field, InputCheckType checkType, java.lang.Object checkValue)`
    `void` | `setEnabled(boolean isEnabled)`
    `static void` | `setInstance(InputValidator validator)` Allows for setting you own instance to be used for field input checking.
    `java.lang.String` | `toDumpString()` Note that this method returns a String with platform specific line breaks.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### InputValidator

          public InputValidator()

  - ### Method Detail

    - #### getInstance

          public static InputValidator getInstance()

    - #### setInstance

          public static void setInstance(InputValidator validator)

      Allows for setting you own instance to be used for field input checking.

    - #### put

          public void put(Field field,
                 InputCheckType checkType,
                 java.lang.Object checkValue)

    - #### checkFieldInput

          public void checkFieldInput(Field field)
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### isUncheckedField

          protected boolean isUncheckedField(Field field)

      Tells whether the field needs input checking. DisplayField and LabelField for instance need no input checking.

    - #### checkExcludedValue

          protected void checkExcludedValue(Field field,
                                java.lang.Object value,
                                java.lang.Object exclValue)
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkMinValue

          protected void checkMinValue(Field field,
                           double value,
                           double minValue)
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkMaxValue

          protected void checkMaxValue(Field field,
                           double value,
                           double maxValue)
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkRange

          protected void checkRange(Field field,
                        double value,
                        double minValue,
                        double maxValue)
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkMinValue

          protected void checkMinValue(Field field,
                           java.util.Date value,
                           java.util.Date minValue)
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkMaxValue

          protected void checkMaxValue(Field field,
                           java.util.Date value,
                           java.util.Date maxValue)
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkRange

          protected void checkRange(Field field,
                        java.util.Date value,
                        java.util.Date minValue,
                        java.util.Date maxValue)
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### toDumpString

          public java.lang.String toDumpString()

      Description copied from class: `DumpableObject`
      Note that this method returns a String with platform specific line breaks. Therefore it can be directly written to any Writer.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

    - #### setEnabled

          public void setEnabled(boolean isEnabled)

    - #### isEnabled

          public boolean isEnabled()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.