Skip to content

Package: EMFFormsDMRExpander

EMFFormsDMRExpander

nameinstructionbranchcomplexitylinemethod
static {...}
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

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.domainexpander;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
18:
19: /**
20: * This service offers the method {@link #prepareDomainObject(VDomainModelReference, EObject)} that allows to expand a
21: * given {@link EObject domain object} for a {@link VDomainModelReference}. The method
22: * {@link #isApplicable(VDomainModelReference)} is used to determine how suitable this service is for a certain
23: * {@link VDomainModelReference}.
24: * <p>
25: * <strong>Note:</strong> This interface is not intended for public use but defines the services which are internally
26: * used in the {@link EMFFormsDomainExpander}.
27: *
28: * @author Lucas Koehler
29: * @since 1.7
30: *
31: */
32: public interface EMFFormsDMRExpander {
33:
34:         /**
35:          * This value is returned by {@link #isApplicable(VDomainModelReference)} if the {@link EMFFormsDMRExpander} is not
36:          * applicable for the given {@link VDomainModelReference} and {@link EObject
37:          * domain object}.
38:          */
39:         Double NOT_APPLICABLE = Double.NEGATIVE_INFINITY;
40:
41:         /**
42:          * Prepares a {@link EObject domain object} for the given {@link VDomainModelReference}. Thereby, the path defined
43:          * by the {@link VDomainModelReference} is analyzed and missing objects in the domain model are created. Thereby,
44:          * the {@link VDomainModelReference} is not changed.
45:          * <p>
46:          * Example:<br/>
47:          * DMR: A -> B -> x<br/>
48:          * domain model is instance of A but does not reference an instance of B<br/>
49:          * => An instance of B is created and referenced by the domain model.
50:          *
51:          * @param domainModelReference The {@link VDomainModelReference} for which the {@link EObject domain object} should
52:          * be prepared.
53:          * @param domainObject The {@link EObject domain object} to prepare.
54:          * @throws EMFFormsExpandingFailedException if the domain expansion fails.
55:          */
56:         void prepareDomainObject(VDomainModelReference domainModelReference, EObject domainObject)
57:                 throws EMFFormsExpandingFailedException;
58:
59:         /**
60:          * Returns how suitable this {@link EMFFormsDMRExpander} is for the given {@link VDomainModelReference}.
61:          *
62:          * @param domainModelReference The {@link VDomainModelReference} for which a {@link EObject domain object} should
63:          * be prepared.
64:          * @return a value indicating how suitable this {@link EMFFormsDMRExpander} is to expand a {@link EObject domain
65:          * object} for the given {@link VDomainModelReference}. Returns NOT_APPLICABLE if it's not applicable.
66:          */
67:         double isApplicable(VDomainModelReference domainModelReference);
68: }