Package com.vaadin.flow.data.binder
Interface BindingExceptionHandler
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultBindingExceptionHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface BindingExceptionHandler extends Serializable
Handles anExceptionwhich may be thrown insideBinder.Bindinglogic to be able to identify the originator of the exception (the originalExceptioninstance usually doesn't contain any information whichHasValueobject is the source of the exception).- Since:
- Author:
- Vaadin Ltd
- See Also:
BindingException
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<BindingException>handleException(HasValue<?,?> field, Exception exception)Produces aBindingExceptioninstance based on originalexceptionand field as a subject of the exception.
-
-
-
Method Detail
-
handleException
Optional<BindingException> handleException(HasValue<?,?> field, Exception exception)
Produces aBindingExceptioninstance based on originalexceptionand field as a subject of the exception.If the method returns an empty optional then the original exception will be thrown in the place where it has been caught.
The produced exception will be thrown instead of the
exceptionand may contain it as a cause and additional information based on thefield.- Parameters:
field- the subject of the exceptionexception- an exception thrown within binding logic- Returns:
- an optional
BindingException, or an empty optional if no additional information should be provided for the thrown exception
-
-