Skip to content

Package: SubTreeFilter

SubTreeFilter

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2017 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.filter;
15:
16: import org.eclipse.emf.common.util.Diagnostic;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emfforms.common.Optional;
19:
20: /**
21: * Interface that allows to skip the validation of sub trees. Only applicable for
22: * ValidationService#validate(java.util.Iterator) in conjunction with a EMF TreeIterator.
23: * See ValidationService#registerValidationFilter(ValidationFilter).
24: *
25: * @author Mat Hansen <mhansen@eclipsesource.com>
26: */
27: public interface SubTreeFilter extends ValidationFilter {
28:
29:         /**
30:          * Return true if the eContents (subtree) of the given {@link EObject} should not be validated.
31:          *
32:          * Note: this is only applicable for ValidationService#validate(java.util.Iterator)
33:          * in conjunction with a EMF TreeIterator.
34:          *
35:          * @param eObject the parent {@link EObject}
36:          * @param diagnostic the {@link Diagnostic} for the {@link EObject} in case it has been validated.
37:          * @return true, if the subtree of the given {@link EObject} should be skipped.
38:          */
39:         boolean skipSubtree(EObject eObject, Optional<Diagnostic> diagnostic);
40:
41: }