Class RuleConditionDmrUtil
- java.lang.Object
-
- org.eclipse.emf.ecp.view.spi.rule.RuleConditionDmrUtil
-
public final class RuleConditionDmrUtil extends java.lang.Object
Utility class for common functionality needed for rule condition DMR tooling.- Since:
- 1.21
- Author:
- Lucas Koehler
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<org.eclipse.emf.ecore.EClass>
getDmrRootEClass(EMFFormsDatabindingEMF databinding, ReportService reportService, org.eclipse.emf.ecore.EObject owner)
Get the root EClass for theVDomainModelReference
to create.static java.util.List<org.eclipse.emf.ecore.EObject>
getDmrRootObject(EMFFormsDatabindingEMF databinding, ReportService reportService, org.eclipse.emf.ecore.EObject domainRoot, org.eclipse.emf.ecore.EObject owner)
Get the root EObjects for the owner's domain model reference.
-
-
-
Method Detail
-
getDmrRootEClass
public static java.util.Optional<org.eclipse.emf.ecore.EClass> getDmrRootEClass(EMFFormsDatabindingEMF databinding, ReportService reportService, org.eclipse.emf.ecore.EObject owner)
Get the root EClass for theVDomainModelReference
to create. If the ruleCondition
is contained in another Condition with a DMR, the root EClass is determined by resolving the container Condition(s) down from the domain root. Otherwise, the root EClass is the EClass of the domain root.- Parameters:
databinding
- TheEMFFormsDatabindingEMF
used to resolve DMRsreportService
- TheReportService
used to report databinding failuresowner
- The condition containing the the DMR whose root EClass is needed- Returns:
- The root EClass or nothing if it could not be determined
-
getDmrRootObject
public static java.util.List<org.eclipse.emf.ecore.EObject> getDmrRootObject(EMFFormsDatabindingEMF databinding, ReportService reportService, org.eclipse.emf.ecore.EObject domainRoot, org.eclipse.emf.ecore.EObject owner)
Get the root EObjects for the owner's domain model reference. IF the owner is not nested in another Condition, the result list simply contains the givendomainRoot
. IF the owner is nested in one or moreIterateConditions
, the iterate conditions' dmrs are resolved and all possible root objects collected and returned.- Parameters:
databinding
- TheEMFFormsDatabindingEMF
used to resolve dmrsreportService
- TheReportService
to report databinding errorsdomainRoot
- The domain root (usually the view model context's domain model)owner
- The eObject containing the dmr (usually aCondition
)- Returns:
- the roots of the owner's dmr. If the owner condition is not nested, the result list contains only the
given domain root. May return an empty list if no root could be determined but never returns
null
-
-