Skip to content

Package: IValidationService

IValidationService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2008-2012 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: ******************************************************************************/
13: package org.eclipse.emf.ecp.validation.api;
14:
15: import java.util.Collection;
16: import java.util.Set;
17:
18: import org.eclipse.emf.common.util.Diagnostic;
19: import org.eclipse.emf.ecore.EObject;
20:
21: /**
22: * Validation service interface.
23: *
24: * @author emueller
25: */
26: public interface IValidationService {
27:
28:         /**
29:          * Validates the given {@link EObject}s.
30:          *
31:          * @param eObjects
32:          * a collection of {@link EObject}s to be validated
33:          * @return the set of affected elements
34:          */
35:         Set<EObject> validate(Collection<EObject> eObjects);
36:
37:         /**
38:          * Validates the given {@link EObject}.
39:          *
40:          * @param eObject
41:          * the {@link EObject} to be validated
42:          * @return the set of affected elements
43:          */
44:         Set<EObject> validate(EObject eObject);
45:
46:         /**
47:          * Returns the severity for the given {@link EObject}.
48:          *
49:          * @param eObject
50:          * the {@link EObject} whose severity should be returned
51:          * @return the severity for the given {@link EObject}
52:          */
53:         Diagnostic getDiagnostic(Object eObject);
54:
55:         /**
56:          * Returns the highest severity.
57:          *
58:          * @return the highest severity
59:          */
60:         Diagnostic getRootDiagnostic();
61:
62:         /**
63:          * Removes the severity of the given {@link EObject}.
64:          *
65:          * @param eObject
66:          * the {@link EObject} whose severity should be removed
67:          */
68:         void remove(EObject eObject);
69: }