Interface EMFFormsDMRSegmentExpander
-
- All Known Implementing Classes:
DummyDomainExpander
,FeatureSegmentExpander
,IndexSegmentExpander
,MappingSegmentExpander
,MultiSegmentExpander
public interface EMFFormsDMRSegmentExpander
This service offers the methodprepareDomainObject(VDomainModelReferenceSegment, EObject)
that allows to expand a givendomain object
for aVDomainModelReferenceSegment
. The methodisApplicable(VDomainModelReferenceSegment)
is used to determine how suitable this service is for a certainVDomainModelReferenceSegment
.Note: This interface is not intended for public use but defines the services which are internally used in the
EMFFormsDomainExpander
.- Since:
- 1.19
- Author:
- Lucas Koehler
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Double
NOT_APPLICABLE
This value is returned byisApplicable(VDomainModelReferenceSegment)
if theEMFFormsDMRSegmentExpander
is not applicable for the givenVDomainModelReferenceSegment
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
isApplicable(VDomainModelReferenceSegment segment)
Returns how suitable thisEMFFormsDMRSegmentExpander
is for the givenVDomainModelReferenceSegment
.boolean
needsToExpandLastSegment()
Returns whether a supportedsegment
needs to be expanded when it is the last segment of aVDomainModelReferenceSegment
.java.util.Optional<org.eclipse.emf.ecore.EObject>
prepareDomainObject(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject)
Prepares adomain object
for the givenVDomainModelReferenceSegment
.
-
-
-
Field Detail
-
NOT_APPLICABLE
static final java.lang.Double NOT_APPLICABLE
This value is returned byisApplicable(VDomainModelReferenceSegment)
if theEMFFormsDMRSegmentExpander
is not applicable for the givenVDomainModelReferenceSegment
.
-
-
Method Detail
-
prepareDomainObject
java.util.Optional<org.eclipse.emf.ecore.EObject> prepareDomainObject(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject) throws EMFFormsExpandingFailedException
Prepares adomain object
for the givenVDomainModelReferenceSegment
. Thereby, the feature defined by the segment is analyzed and if it is a reference, the missing target object will be created. Thereby, the segment is not changed. The target of the segment's feature is returned. This is the createdEObject
if it was created by this method or the already existing target of the segment's feature.Example:
DMR: A -a-> B
The domain model is instance of A but does not reference an instance of B. The segment contains the feature 'a'.
=> An instance of B is created and referenced by the domain model. B is returned by this expander.- Parameters:
segment
- TheVDomainModelReferenceSegment
for which thedomain object
should be prepared.domainObject
- Thedomain object
to prepare.- Returns:
- The new target of the segment's feature. If an
EObject
was created, it is returned, otherwise the already existing target is returned. May return nothing. If the given segment was not the DMR's last segment, this causes the DMR expansion process to fail. - Throws:
EMFFormsExpandingFailedException
- if the domain expansion fails.
-
isApplicable
double isApplicable(VDomainModelReferenceSegment segment)
Returns how suitable thisEMFFormsDMRSegmentExpander
is for the givenVDomainModelReferenceSegment
.- Parameters:
segment
- TheVDomainModelReferenceSegment
for which andomain object
should be prepared.- Returns:
- a value indicating how suitable this
EMFFormsDMRSegmentExpander
is to expand adomain object
for the givenVDomainModelReferenceSegment
. Returns NOT_APPLICABLE if it's not applicable.
-
needsToExpandLastSegment
boolean needsToExpandLastSegment()
Returns whether a supportedsegment
needs to be expanded when it is the last segment of aVDomainModelReferenceSegment
.- Returns:
- Whether the last segment needs to be expanded
-
-