Class AbstractValidator

java.lang.Object
fr.paris.lutece.plugins.forms.validation.AbstractValidator
All Implemented Interfaces:
IValidator
Direct Known Subclasses:
AbstractDateValidator, AbstractDayDistanceValidator, AbstractListQuestionValidator, AbstractNumberValidator, AbstractPatternValidator, ListExactResponseValidator, ListMaxResponseValidator, ListMinResponseValidator, ListValueValidator, UniqueValidator

public abstract class AbstractValidator extends Object implements IValidator
  • Constructor Details

    • AbstractValidator

      public AbstractValidator(String strValidatorName, String strValidatorDisplayName, List<String> listAvailableEntryType)
      Constructor of the AbstractValidator
      Parameters:
      strValidatorName - The validator bean name
      strValidatorDisplayName - The validator display name
      listAvailableEntryType - The list of available entrytype
    • AbstractValidator

      public AbstractValidator(String strValidatorName, String strValidatorDisplayName, List<String> listAvailableEntryType, Locale locale)
      Constructor of the AbstractValidator
      Parameters:
      strValidatorName - The validator bean name
      strValidatorDisplayName - The validator display name
      listAvailableEntryType - The list of available entrytype
      locale - The locale
  • Method Details

    • validate

      public boolean validate(List<FormQuestionResponse> formQuestionResponse, Control control)
      Specified by:
      validate in interface IValidator
      Parameters:
      formQuestionResponse - The List response to control
      control - The control to verify
      Returns:
      boolean that indicate the validation result
    • getValidatorBeanName

      public String getValidatorBeanName()
      Specified by:
      getValidatorBeanName in interface IValidator
      Returns:
      the validator bean name
    • getValidatorDisplayName

      public String getValidatorDisplayName()
      Specified by:
      getValidatorDisplayName in interface IValidator
      Returns:
      the validator display name
    • getDisplayHtml

      public String getDisplayHtml(Control control)
      Specified by:
      getDisplayHtml in interface IValidator
      Parameters:
      control - The control to build model
      Returns:
      the HTML to display
    • getListAvailableEntryType

      public List<String> getListAvailableEntryType()
      Specified by:
      getListAvailableEntryType in interface IValidator
      Returns:
      the list of available entrytype for this validator
    • getJavascriptValidation

      public String getJavascriptValidation()
      Description copied from interface: IValidator
      Only the content of the function should be returned. The parameter names are in FormsConstants, JS_PARAMETER_INPUT_VALUE and JS_PARAMETER_CONTROL_VALUE
      Specified by:
      getJavascriptValidation in interface IValidator
      Returns:
      the javascript validation code for Conditional display control
    • getJavascriptControlValue

      public String getJavascriptControlValue(Control control)
      Specified by:
      getJavascriptControlValue in interface IValidator
      Parameters:
      control - The control
      Returns:
      the control value needed for javascript