Class EMFFormsDMRExpanderDefaultHeuristic
- java.lang.Object
-
- org.eclipse.emfforms.internal.core.services.domainexpander.defaultheuristic.EMFFormsDMRExpanderDefaultHeuristic
-
- All Implemented Interfaces:
EMFFormsDMRExpander
public class EMFFormsDMRExpanderDefaultHeuristic extends java.lang.Object implements EMFFormsDMRExpander
Default implementation ofEMFFormsDMRExpander
.- Author:
- Lucas Koehler
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emfforms.spi.core.services.domainexpander.EMFFormsDMRExpander
NOT_APPLICABLE
-
-
Constructor Summary
Constructors Constructor Description EMFFormsDMRExpanderDefaultHeuristic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
isApplicable(VDomainModelReference domainModelReference)
Returns how suitable thisEMFFormsDMRExpander
is for the givenVDomainModelReference
.void
prepareDomainObject(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject domainObject)
Prepares adomain object
for the givenVDomainModelReference
.protected void
setReportService(ReportService reportService)
Called by the framework to set theReportService
.
-
-
-
Method Detail
-
setReportService
protected void setReportService(ReportService reportService)
Called by the framework to set theReportService
.- Parameters:
reportService
- TheReportService
-
prepareDomainObject
public void prepareDomainObject(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject domainObject) throws EMFFormsExpandingFailedException
Prepares adomain object
for the givenVDomainModelReference
. Thereby, the path defined by theVDomainModelReference
is analyzed and missing objects in the domain model are created. Thereby, theVDomainModelReference
is not changed.Example:
DMR: A -> B -> x
domain model is instance of A but does not reference an instance of B
=> An instance of B is created and referenced by the domain model.- Specified by:
prepareDomainObject
in interfaceEMFFormsDMRExpander
- Parameters:
domainModelReference
- TheVDomainModelReference
for which thedomain object
should be prepared.domainObject
- Thedomain object
to prepare.- Throws:
EMFFormsExpandingFailedException
- if the domain expansion fails.- See Also:
EMFFormsDMRExpander.prepareDomainObject(org.eclipse.emf.ecp.view.spi.model.VDomainModelReference, org.eclipse.emf.ecore.EObject)
-
isApplicable
public double isApplicable(VDomainModelReference domainModelReference)
Returns how suitable thisEMFFormsDMRExpander
is for the givenVDomainModelReference
.- Specified by:
isApplicable
in interfaceEMFFormsDMRExpander
- Parameters:
domainModelReference
- TheVDomainModelReference
for which adomain object
should be prepared.- Returns:
- a value indicating how suitable this
EMFFormsDMRExpander
is to expand adomain object
for the givenVDomainModelReference
. Returns NOT_APPLICABLE if it's not applicable. - See Also:
EMFFormsDMRExpander.isApplicable(org.eclipse.emf.ecp.view.spi.model.VDomainModelReference)
-
-