Skip to content

Package: Validator

Validator

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 java.util.List;
17:
18: import org.eclipse.emf.common.util.Diagnostic;
19: import org.eclipse.emf.ecore.EObject;
20:
21: /**
22: * Interface for custom validators to be registered on a {@link ValidationService}.
23: *
24: * @author Mat Hansen <mhansen@eclipsesource.com>
25: */
26: public interface Validator {
27:
28:         /**
29:          * Method is called by the {@link ValidationService} to retrieve addition validation
30:          * information for the given {@link EObject}.
31:          *
32:          * @param eObject the {@link EObject} to validate
33:          * @return the List of additional {@link Diagnostic Diagnostics} for the {@link EObject}
34:          */
35:         // TODO possibly refactor interface to void validate(EObject eObject, List<Diagnostic>);
36:         List<Diagnostic> validate(EObject eObject);
37:
38: }