Skip to content

Package: EMFFormsMappingProvider

EMFFormsMappingProvider

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.core.services.mappingprovider;
15:
16: import java.util.Set;
17:
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emf.ecp.common.spi.UniqueSetting;
20: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
21:
22: /**
23: * A service to provide {@link UniqueSetting} to {@link VDomainModelReference} mappings.
24: *
25: * @author Lucas Koehler
26: * @since 1.8
27: *
28: */
29: public interface EMFFormsMappingProvider {
30:
31:         /**
32:          * The constant defining the priority that a {@link EMFFormsMappingProvider} is not applicable for a
33:          * {@link VDomainModelReference} and {@link EObject domain object}.
34:          */
35:         double NOT_APPLICABLE = Double.NEGATIVE_INFINITY;
36:
37:         /**
38:          * Returns the mapping of {@link UniqueSetting UniqueSettings} to their sets of {@link VDomainModelReference
39:          * VDomainModelReference} for a
40:          * given {@link VDomainModelReference} and {@link EObject domain object}.
41:          *
42:          * @param domainModelReference The {@link VDomainModelReference}
43:          * @param domainObject The {@link EObject domain object}
44:          * @return The mapping from the {@link UniqueSetting UniqueSettings} to their sets of {@link VDomainModelReference
45:          * VDomainModelReference}
46:          */
47:         Set<UniqueSetting> getMappingFor(VDomainModelReference domainModelReference, EObject domainObject);
48:
49:         /**
50:          * Returns a double indicating if and how well this {@link EMFFormsMappingProvider} is applicable for the given
51:          * {@link VDomainModelReference} and {@link EObject domain object}.
52:          *
53:          * @param domainModelReference The given {@link VDomainModelReference}
54:          * @param domainObject The {@link EObject domain object}
55:          * @return The floating point value indicating the applicability
56:          */
57:         double isApplicable(VDomainModelReference domainModelReference, EObject domainObject);
58: }