Interface Validator

All Known Implementing Classes:
AttributeLengthValidator, AttributePresenceValidator, BooleanValidator, DateValidator, EmailValidator, ImplicitConversionValidator, JSONValidator, ListValidator, MapValidator, NumericValidator, RangeValidator, RegexpValidator, TimestampValidator, ValidatorAdapter

public interface Validator
  • Method Summary

    Modifier and Type
    Method
    Description
    formatMessage​(Locale locale, Object... params)
    Formats a message with locale.
    void
    Will pin the current message.
    void
    setMessage​(String message)
    Sets an message on this validator.
    void
    validate​(Validatable validatable)
    Called by framework when validation is required
  • Method Details

    • validate

      void validate(Validatable validatable)
      Called by framework when validation is required
      Parameters:
      validatable - map being validated.
    • setMessage

      void setMessage(String message)
      Sets an message on this validator.
      Parameters:
      message - error message.
    • formatMessage

      String formatMessage(Locale locale, Object... params)
      Formats a message with locale.
      Parameters:
      locale - locale to use.
      params - parameters in case a message is parametrized.
      Returns:
      formatted message
    • pinMessage

      void pinMessage()
      Will pin the current message. It will ignore any messages generated duringt validation and will use a current message.