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 doubleisApplicable(VDomainModelReferenceSegment segment)Returns how suitable thisEMFFormsDMRSegmentExpanderis for the givenVDomainModelReferenceSegment.booleanneedsToExpandLastSegment()Returns whether a supportedsegmentneeds 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 objectfor 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:EMFFormsDMRSegmentExpanderPrepares adomain objectfor 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 createdEObjectif 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:
prepareDomainObjectin interfaceEMFFormsDMRSegmentExpander- Parameters:
segment- TheVDomainModelReferenceSegmentfor which thedomain objectshould be prepared.domainObject- Thedomain objectto prepare.- Returns:
- The new target of the segment's feature. If an
EObjectwas 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:EMFFormsDMRSegmentExpanderReturns how suitable thisEMFFormsDMRSegmentExpanderis for the givenVDomainModelReferenceSegment.- Specified by:
isApplicablein interfaceEMFFormsDMRSegmentExpander- Parameters:
segment- TheVDomainModelReferenceSegmentfor which andomain objectshould be prepared.- Returns:
- a value indicating how suitable this
EMFFormsDMRSegmentExpanderis to expand adomain objectfor the givenVDomainModelReferenceSegment. Returns NOT_APPLICABLE if it's not applicable.
-
needsToExpandLastSegment
public boolean needsToExpandLastSegment()
Description copied from interface:EMFFormsDMRSegmentExpanderReturns whether a supportedsegmentneeds to be expanded when it is the last segment of aVDomainModelReferenceSegment.- Specified by:
needsToExpandLastSegmentin interfaceEMFFormsDMRSegmentExpander- Returns:
- Whether the last segment needs to be expanded
-
-