Interface ListPostConversionValidator<A extends Annotation,T>

All Superinterfaces:
Policy<A>
All Known Implementing Classes:
AbstractCustomListPostConversionValidatorSupport, AbstractListPostConversionValidatorSupport, MinIntegerEntryCountListPostConversionValidator, MinStringEntryCountListPostConversionValidator, RequiredIntegerEntriesValidator, RequiredStringEntriesValidator

public interface ListPostConversionValidator<A extends Annotation,T> extends Policy<A>
Interface for list post conversion validators used by AnnotationValidationInterceptor and AnnotationValidationInterceptor2. Despite the name, recipient form fields can be non-list collections and arrays. This is useful for validating the list as a whole, such as non-empty list, and are run after individual entry post-conversion validators.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns message set by annotation.
    Returns message key set by annotation, which is used to retrieve message from Action's TextProvider if it's not empty string.
    Returns whether to write any error message to action errors, field errors, or action messages.
    boolean
    Returns whether validator should not be skipped if conversion was skipped.
    Returns item types of recipient collection fields that can receive converted form value.
    boolean
    Returns whether rejection by this validator should stop further validation.
    validate(Collection<T> formValue)
    Returns result of checking converted form field value and message to use if failed.

    Methods inherited from interface name.matthewgreet.strutscommons.policy.Policy

    getAnnotation, setAnnotation
  • Method Details

    • getMessageType

      Required.MessageType getMessageType()
      Returns whether to write any error message to action errors, field errors, or action messages.
    • getMessage

      String getMessage()
      Returns message set by annotation. Used if getMessageKey() is empty string or it fails to find a message.
    • getMessageKey

      String getMessageKey()
      Returns message key set by annotation, which is used to retrieve message from Action's TextProvider if it's not empty string.
    • getRecipientClass

      Class<T> getRecipientClass()
      Returns item types of recipient collection fields that can receive converted form value. Not to be confused with collection type.
    • getShortCircuit

      boolean getShortCircuit()
      Returns whether rejection by this validator should stop further validation.
    • getProcessNoValue

      boolean getProcessNoValue()
      Returns whether validator should not be skipped if conversion was skipped.
    • validate

      ValidationResult validate(Collection<T> formValue) throws Exception
      Returns result of checking converted form field value and message to use if failed. This is not called if the form value is empty string or null or the conversion failed.
      Throws:
      Exception