BinderValidationStatus implements Serializable { public List<BindingValidationStatus<?>> getFieldValidationStatuses() { return bindingStatuses; } BinderValidationStatus(Binder<BEAN> source,
            List<BindingValidationStatus<?>> bindingStatuses,
            List<ValidationResult> binderStatuses); static BinderValidationStatus<BEAN> createUnresolvedStatus(
            Binder<BEAN> source); boolean isOk(); boolean hasErrors(); Binder<BEAN> getBinder(); List<ValidationResult> getValidationErrors(); List<BindingValidationStatus<?>> getFieldValidationStatuses(); List<ValidationResult> getBeanValidationResults(); List<BindingValidationStatus<?>> getFieldValidationErrors(); List<ValidationResult> getBeanValidationErrors(); void notifyBindingValidationStatusHandlers(); void notifyBindingValidationStatusHandlers(
            SerializablePredicate<BindingValidationStatus<?>> filter);  }
@Test public void binderWithStatusHandler_replaceHandler() { AtomicReference<BinderValidationStatus<?>> capture = new AtomicReference<>(); BindingBuilder<Person, String> binding = binder.forField(nameField); binding.bind(Person::getFirstName, Person::setFirstName); binder.setValidationStatusHandler(results -> Assert.fail()); binder.setValidationStatusHandler(capture::set); nameField.setValue("foo"); binder.validate(); List<BindingValidationStatus<?>> results = capture.get() .getFieldValidationStatuses(); Assert.assertNotNull(results); Assert.assertEquals(1, results.size()); Assert.assertFalse(results.get(0).isError()); assertValidField(nameField); }
@Test public void binderWithStatusHandler_replaceHandler() { AtomicReference<BinderValidationStatus<?>> capture = new AtomicReference<>(); BindingBuilder<Person, String> binding = binder.forField(nameField); binding.bind(Person::getFirstName, Person::setFirstName); binder.setValidationStatusHandler(results -> fail()); binder.setValidationStatusHandler(results -> capture.set(results)); nameField.setValue("foo"); binder.validate(); List<BindingValidationStatus<?>> results = capture.get() .getFieldValidationStatuses(); assertNotNull(results); assertEquals(1, results.size()); assertFalse(results.get(0).isError()); }