public class DummyDomainExpander extends Object implements EMFFormsDMRSegmentExpander
NOT_APPLICABLE| Modifier and Type | Method and Description |
|---|---|
double |
isApplicable(VDomainModelReferenceSegment segment)
Returns how suitable this
EMFFormsDMRSegmentExpander is for the given
VDomainModelReferenceSegment. |
boolean |
needsToExpandLastSegment()
Returns whether a supported
segment needs to be expanded when it is the last
segment of a VDomainModelReferenceSegment. |
Optional<org.eclipse.emf.ecore.EObject> |
prepareDomainObject(VDomainModelReferenceSegment segment,
org.eclipse.emf.ecore.EObject domainObject)
Prepares a
domain object for the given VDomainModelReferenceSegment. |
public Optional<org.eclipse.emf.ecore.EObject> prepareDomainObject(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject) throws EMFFormsExpandingFailedException
EMFFormsDMRSegmentExpanderdomain object for the given VDomainModelReferenceSegment. 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 created EObject
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.
prepareDomainObject in interface EMFFormsDMRSegmentExpandersegment - The VDomainModelReferenceSegment for which the domain object should be
prepared.domainObject - The domain object to prepare.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.EMFFormsExpandingFailedException - if the domain expansion fails.public double isApplicable(VDomainModelReferenceSegment segment)
EMFFormsDMRSegmentExpanderEMFFormsDMRSegmentExpander is for the given
VDomainModelReferenceSegment.isApplicable in interface EMFFormsDMRSegmentExpandersegment - The VDomainModelReferenceSegment for which an domain object should
be prepared.EMFFormsDMRSegmentExpander is to expand a domain object for the given VDomainModelReferenceSegment. Returns NOT_APPLICABLE if it's not
applicable.public boolean needsToExpandLastSegment()
EMFFormsDMRSegmentExpandersegment needs to be expanded when it is the last
segment of a VDomainModelReferenceSegment.needsToExpandLastSegment in interface EMFFormsDMRSegmentExpanderCopyright © 2020. All rights reserved.