Skip to content

Package: DummyDomainExpander

DummyDomainExpander

nameinstructionbranchcomplexitylinemethod
DummyDomainExpander(VDomainModelReferenceSegment)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
isApplicable(VDomainModelReferenceSegment)
M: 0 C: 9
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
needsToExpandLastSegment()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
prepareDomainObject(VDomainModelReferenceSegment, EObject)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2019 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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.swt.internal.reference.table;
15:
16: import java.util.Optional;
17:
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReferenceSegment;
20: import org.eclipse.emfforms.spi.core.services.domainexpander.EMFFormsDMRSegmentExpander;
21: import org.eclipse.emfforms.spi.core.services.domainexpander.EMFFormsExpandingFailedException;
22:
23: /**
24: * Dummy Domain expander doing nothing because we do not need to expand the extent segments.
25: *
26: * @author Lucas Koehler
27: * @since 1.27
28: *
29: */
30: public class DummyDomainExpander implements EMFFormsDMRSegmentExpander {
31:
32:         private final VDomainModelReferenceSegment segment;
33:
34:         /**
35:          * Default constructor.
36:          *
37:          * @param segment The {@link VDomainModelReferenceSegment} which this expander is applicable for
38:          */
39:         DummyDomainExpander(VDomainModelReferenceSegment segment) {
40:                 this.segment = segment;
41:         }
42:
43:         @Override
44:         public Optional<EObject> prepareDomainObject(VDomainModelReferenceSegment segment, EObject domainObject)
45:                 throws EMFFormsExpandingFailedException {
46:                 // We do not need expansion for the extent segment
47:                 return Optional.empty();
48:         }
49:
50:         @Override
51:         public double isApplicable(VDomainModelReferenceSegment segment) {
52:•                return this.segment == segment ? Double.POSITIVE_INFINITY : NOT_APPLICABLE;
53:         }
54:
55:         @Override
56:         public boolean needsToExpandLastSegment() {
57:                 return false;
58:         }
59:
60: }