use of org.eclipse.sirius.components.collaborative.validation.api.ValidationConfiguration in project sirius-components by eclipse-sirius.
the class ValidationEventProcessorFactory method createRepresentationEventProcessor.
@Override
public <T extends IRepresentationEventProcessor> Optional<T> createRepresentationEventProcessor(Class<T> representationEventProcessorClass, IRepresentationConfiguration configuration, IEditingContext editingContext) {
if (IValidationEventProcessor.class.isAssignableFrom(representationEventProcessorClass) && configuration instanceof ValidationConfiguration) {
ValidationDescription validationDescription = this.validationDescriptionProvider.getDescription();
ValidationContext validationContext = new ValidationContext(null);
IRepresentationEventProcessor validationEventProcessor = new ValidationEventProcessor(editingContext, validationDescription, validationContext, this.validationEventHandlers, this.subscriptionManagerFactory.create(), new SimpleMeterRegistry(), this.representationRefreshPolicyRegistry);
// @formatter:off
return Optional.of(validationEventProcessor).filter(representationEventProcessorClass::isInstance).map(representationEventProcessorClass::cast);
// @formatter:on
}
return Optional.empty();
}
Aggregations