com.vaadin.flow.data.binder.
Interface BindingExceptionHandler
-
All Superinterfaces:
All Known Implementing Classes:
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 an
Exception
which may be thrown insideBinder.Binding
logic to be able to identify the originator of the exception (the originalException
instance usually doesn't contain any information whichHasValue
object is the source of the exception).Since:
Author:
Vaadin Ltd
See Also:
-
-
Method Summary
All Methods Modifier and Type Method Description Optional<BindingException>
handleException(HasValue<?,?> field, Exception exception)
Produces a
BindingException
instance based on originalexception
and field as a subject of the exception.
-
-
-
Method Detail
-
handleException
Optional<BindingException> handleException(HasValue<?,?> field, Exception exception)
Produces a
BindingException
instance based on originalexception
and 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
exception
and may contain it as a cause and additional information based on thefield
.Parameters:
field
- the subject of the exceptionexception
- an exception thrown within binding logicReturns:
an optional
BindingException
, or an empty optional if no additional information should be provided for the thrown exception
-
-