Skip to content

Package: EMFFormsSegmentGenerator

EMFFormsSegmentGenerator

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2018 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.segments;
15:
16: import java.util.List;
17:
18: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
19: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReferenceSegment;
20:
21: /**
22: * An {@link EMFFormsSegmentGenerator} allows to generate segments based on a given {@link VDomainModelReference}.
23: * Thereby, the generated segments resolve equivalent to the given DMR.
24: *
25: * @author Lucas Koehler
26: * @noimplement This interface is not intended to be implemented by clients. Instead, clients should implement
27: * {@link DmrSegmentGenerator} to support custom {@link VDomainModelReference domain model reference}
28: * implementations
29: */
30: public interface EMFFormsSegmentGenerator {
31:
32:         /**
33:          * Takes a {@link VDomainModelReference} and generates the list of equivalent {@link VDomainModelReferenceSegment
34:          * DMR Segments}. Equivalent means that a DMR using the generated segments resolves exactly the same as the given
35:          * DMR.
36:          * <p>
37:          * The segment generation <strong>is side-effect free</strong>. This means neither the given DMR nor any of its
38:          * contained or referenced elements is changed.
39:          *
40:          * @param reference The {@link VDomainModelReference} to generate the {@link VDomainModelReferenceSegment
41:          * segments} for
42:          * @return The list of generated {@link VDomainModelReferenceSegment segments}; might return an empty list if the
43:          * given DMR does not specify any path but never <code>null</code>
44:          */
45:         List<VDomainModelReferenceSegment> generateSegments(VDomainModelReference reference);
46: }