Class DummyDomainExpander
- java.lang.Object
-
- org.eclipse.emfforms.swt.internal.reference.table.DummyDomainExpander
-
- All Implemented Interfaces:
EMFFormsDMRSegmentExpander
public class DummyDomainExpander extends java.lang.Object implements EMFFormsDMRSegmentExpander
Dummy Domain expander doing nothing because we do not need to expand the extent segments.- Since:
- 1.27
- Author:
- Lucas Koehler
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emfforms.spi.core.services.domainexpander.EMFFormsDMRSegmentExpander
NOT_APPLICABLE
-
-
Method Summary
All Methods Instance Methods Concrete 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
.
-
-
-
Method Detail
-
prepareDomainObject
public java.util.Optional<org.eclipse.emf.ecore.EObject> prepareDomainObject(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject) throws EMFFormsExpandingFailedException
Description copied from interface:EMFFormsDMRSegmentExpander
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.- Specified by:
prepareDomainObject
in interfaceEMFFormsDMRSegmentExpander
- 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
public double isApplicable(VDomainModelReferenceSegment segment)
Description copied from interface:EMFFormsDMRSegmentExpander
Returns how suitable thisEMFFormsDMRSegmentExpander
is for the givenVDomainModelReferenceSegment
.- Specified by:
isApplicable
in interfaceEMFFormsDMRSegmentExpander
- 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
public boolean needsToExpandLastSegment()
Description copied from interface:EMFFormsDMRSegmentExpander
Returns whether a supportedsegment
needs to be expanded when it is the last segment of aVDomainModelReferenceSegment
.- Specified by:
needsToExpandLastSegment
in interfaceEMFFormsDMRSegmentExpander
- Returns:
- Whether the last segment needs to be expanded
-
-