use of org.eclipse.emf.ecore.util.Diagnostician in project sirius-components by eclipse-sirius.
the class EMFValidationService method validate.
@Override
public List<Object> validate(Object object, Object feature) {
if (object instanceof EObject) {
Diagnostician diagnostician = this.getNewDiagnostician();
Diagnostic diagnostic = diagnostician.validate((EObject) object);
if (Diagnostic.OK != diagnostic.getSeverity()) {
// @formatter:off
return diagnostic.getChildren().stream().filter(diag -> this.filterDiagnosticByObject(diag, object)).filter(diag -> this.filterDiagnosticByFeature(diag, feature)).collect(Collectors.toList());
// @formatter:on
}
}
return List.of();
}
Aggregations