Module org.apache.jena.shacl
Package org.apache.jena.shacl.validation
Class HandlerBasedValidationListener
java.lang.Object
org.apache.jena.shacl.validation.HandlerBasedValidationListener
- All Implemented Interfaces:
ValidationListener
ValidationListener implementation that allows for registering event handlers on a per-type basis.
The handlers can be registered with any subclass or sub-interface of 'ValidationEvent', i.e., concrete event classes their superclasses or interfaces.
Example:ValidationListener myListener = HandlerBasedValidationListener .builder() .forEventType(FocusNodeValidationStartedEvent.class) .addSimpleHandler(e -> { // ... }) .forEventType(ConstraintEvaluatedEvent.class) .addSimpleHandler(e -> { // will be called for any subclass of ConstraintEvaluatedEvent }) .build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static interface
static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder
(HandlerBasedValidationListener.HandlerSelectionStrategy handlerSelectionStrategy) void
-
Method Details
-
builder
public static HandlerBasedValidationListener.Builder builder(HandlerBasedValidationListener.HandlerSelectionStrategy handlerSelectionStrategy) -
builder
-
onValidationEvent
- Specified by:
onValidationEvent
in interfaceValidationListener
-