public interface EMFFormsDMRSegmentExpander
prepareDomainObject(VDomainModelReferenceSegment, EObject)
that allows to
expand a given domain object
for a VDomainModelReferenceSegment
. The method
isApplicable(VDomainModelReferenceSegment)
is used to determine how suitable this service is for a certain
VDomainModelReferenceSegment
.
Note: This interface is not intended for public use but defines the services which are internally
used in the EMFFormsDomainExpander
.
Modifier and Type | Field and Description |
---|---|
static Double |
NOT_APPLICABLE
This value is returned by
isApplicable(VDomainModelReferenceSegment) if the
EMFFormsDMRSegmentExpander is not applicable for the given VDomainModelReferenceSegment . |
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 . |
static final Double NOT_APPLICABLE
isApplicable(VDomainModelReferenceSegment)
if the
EMFFormsDMRSegmentExpander
is not applicable for the given VDomainModelReferenceSegment
.Optional<org.eclipse.emf.ecore.EObject> prepareDomainObject(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject) throws EMFFormsExpandingFailedException
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.
segment
- 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.double isApplicable(VDomainModelReferenceSegment segment)
EMFFormsDMRSegmentExpander
is for the given
VDomainModelReferenceSegment
.segment
- 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.boolean needsToExpandLastSegment()
segment
needs to be expanded when it is the last
segment of a VDomainModelReferenceSegment
.Copyright © 2019. All rights reserved.