Interface EMFFormsDMRSegmentExpander

    • Method Detail

      • prepareDomainObject

        java.util.Optional<org.eclipse.emf.ecore.EObject> prepareDomainObject​(VDomainModelReferenceSegment segment,
                                                                              org.eclipse.emf.ecore.EObject domainObject)
                                                                       throws EMFFormsExpandingFailedException
        Prepares a domain 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.

        Parameters:
        segment - The VDomainModelReferenceSegment for which the domain object should be prepared.
        domainObject - The domain 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.
      • needsToExpandLastSegment

        boolean needsToExpandLastSegment()
        Returns whether a supported segment needs to be expanded when it is the last segment of a VDomainModelReferenceSegment.
        Returns:
        Whether the last segment needs to be expanded