Skip to content

Package: ValidationResultListener

ValidationResultListener

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Mat Hansen - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.common.spi.validation;
15:
16: import org.eclipse.emf.common.util.Diagnostic;
17: import org.eclipse.emf.ecore.EObject;
18:
19: /**
20: * Diagnostic listener which can be used to subscribe to {@link Diagnostic} changes during model validation.
21: *
22: * @author Mat Hansen <mhansen@eclipsesource.com>
23: */
24: public interface ValidationResultListener {
25:
26:         /**
27:          * Callback which is invoked for every validation result.
28:          *
29:          * @param eObject the eObject which has been validated
30:          * @param diagnostic the {@link Diagnostic} result of the validation
31:          */
32:         void onValidate(EObject eObject, Diagnostic diagnostic);
33:
34:         /**
35:          * Callback which is invoked for every validation result which passed filtering.
36:          * Validation result has been added to the validator output at this point.
37:          *
38:          * Note: this method is not triggered by {@link ValidationService#validate(EObject)}.
39:          *
40:          * @param eObject the eObject which has been validated
41:          * @param diagnostic the {@link Diagnostic} result of the validation
42:          */
43:         void afterValidate(EObject eObject, Diagnostic diagnostic);
44:
45: }