Class BinderValidationStatus<BEAN>

    • Constructor Detail

      • BinderValidationStatus

        public BinderValidationStatus​(Binder<BEAN> source,
                                      List<BindingValidationStatus<?>> bindingStatuses,
                                      List<ValidationResult> binderStatuses)
        Creates a new binder validation status for the given binder and validation results.
        Parameters:
        source - the source binder
        bindingStatuses - the validation results for the fields
        binderStatuses - the validation results for binder level validation
    • Method Detail

      • createUnresolvedStatus

        public static <BEAN> BinderValidationStatus<BEAN> createUnresolvedStatus​(Binder<BEAN> source)
        Convenience method for creating a unresolved validation status for the given binder.

        In practice this status means that the values might not be valid, but validation errors should be hidden.

        Type Parameters:
        BEAN - the bean type of the binder
        Parameters:
        source - the source binder
        Returns:
        a unresolved validation status
      • isOk

        public boolean isOk()
        Gets whether validation for the binder passed or not.
        Returns:
        true if validation has passed, false if not
      • hasErrors

        public boolean hasErrors()
        Gets whether the validation for the binder failed or not.
        Returns:
        true if validation failed, false if validation passed
      • getBinder

        public Binder<BEAN> getBinder()
        Gets the source binder of the status.
        Returns:
        the source binder
      • getValidationErrors

        public List<ValidationResult> getValidationErrors()
        Gets both field and bean level validation errors.
        Returns:
        a list of all validation errors
      • getBeanValidationResults

        public List<ValidationResult> getBeanValidationResults()
        Gets the bean level validation results.
        Returns:
        the bean level validation results
      • getBeanValidationErrors

        public List<ValidationResult> getBeanValidationErrors()
        Gets the failed bean level validation results.
        Returns:
        a list of failed bean level validation results