Class ConditionServiceManagerImpl
- java.lang.Object
-
- org.eclipse.emf.ecp.view.internal.rule.ConditionServiceManagerImpl
-
- All Implemented Interfaces:
ConditionServiceManager
public class ConditionServiceManagerImpl extends java.lang.Object implements ConditionServiceManager
The internal component implementation of the ConditionServiceManager.- Author:
- Eugen Neufeld
-
-
Constructor Summary
Constructors Constructor Description ConditionServiceManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends Condition>
voidaddConditionService(ConditionService<Condition> conditionService)
Called by the framework to add a ConditionService.boolean
evaluate(Condition condition, org.eclipse.emf.ecore.EObject domainModel)
Evaluates the given condition using the provided domain model.boolean
evaluateChangedValues(Condition condition, org.eclipse.emf.ecore.EObject domainModel, java.util.Map<org.eclipse.emf.ecore.EStructuralFeature.Setting,java.lang.Object> possibleNewValues)
Evaluates whether the given condition using the provided domain model will change if a specific setting will be set to a specific value.java.util.Set<UniqueSetting>
getConditionSettings(Condition condition, org.eclipse.emf.ecore.EObject domainModel)
Returns the conditionSetting for a condition and the corresponding domain model.java.util.Set<VDomainModelReference>
getDomainModelReferences(Condition condition)
The Set of DomainModelReferences this condition needs to evaluate.protected void
removeConditionService(ConditionService<Condition> conditionService)
Called by the framework to remove a ConditionService.
-
-
-
Method Detail
-
addConditionService
protected <T extends Condition> void addConditionService(ConditionService<Condition> conditionService)
Called by the framework to add a ConditionService.- Type Parameters:
T
- The type of the added ConditionService- Parameters:
conditionService
- The ConditionService to add
-
removeConditionService
protected void removeConditionService(ConditionService<Condition> conditionService)
Called by the framework to remove a ConditionService.- Parameters:
conditionService
- The ConditionService to remove
-
getConditionSettings
public java.util.Set<UniqueSetting> getConditionSettings(Condition condition, org.eclipse.emf.ecore.EObject domainModel)
Returns the conditionSetting for a condition and the corresponding domain model.- Specified by:
getConditionSettings
in interfaceConditionServiceManager
- Parameters:
condition
- The condition to get the settings fordomainModel
- The domain model this condition applies to- Returns:
- The Set of Settings. This set cannot be null.
- See Also:
ConditionServiceManager.getConditionSettings(org.eclipse.emf.ecp.view.spi.rule.model.Condition, org.eclipse.emf.ecore.EObject)
-
evaluate
public boolean evaluate(Condition condition, org.eclipse.emf.ecore.EObject domainModel)
Evaluates the given condition using the provided domain model.- Specified by:
evaluate
in interfaceConditionServiceManager
- Parameters:
condition
- The condition to evaluate.domainModel
- The root domain object of this condition.- Returns:
true
, if the condition matches,false
otherwise- See Also:
ConditionServiceManager.evaluate(org.eclipse.emf.ecp.view.spi.rule.model.Condition, org.eclipse.emf.ecore.EObject)
-
evaluateChangedValues
public boolean evaluateChangedValues(Condition condition, org.eclipse.emf.ecore.EObject domainModel, java.util.Map<org.eclipse.emf.ecore.EStructuralFeature.Setting,java.lang.Object> possibleNewValues)
Evaluates whether the given condition using the provided domain model will change if a specific setting will be set to a specific value.- Specified by:
evaluateChangedValues
in interfaceConditionServiceManager
- Parameters:
condition
- The condition to evaluate.domainModel
- The root domain object of this condition.possibleNewValues
- the new value that should be compared against the expected value of the condition- Returns:
true
, if the condition matches,false
otherwise- See Also:
ConditionServiceManager.evaluateChangedValues(org.eclipse.emf.ecp.view.spi.rule.model.Condition, org.eclipse.emf.ecore.EObject, java.util.Map)
-
getDomainModelReferences
public java.util.Set<VDomainModelReference> getDomainModelReferences(Condition condition)
The Set of DomainModelReferences this condition needs to evaluate.- Specified by:
getDomainModelReferences
in interfaceConditionServiceManager
- Parameters:
condition
- The condition to retrieve the VDomainModelReferences for- Returns:
- The Set of DomainModelReferences. The set cannot be null.
- See Also:
ConditionServiceManager.getDomainModelReferences(org.eclipse.emf.ecp.view.spi.rule.model.Condition)
-
-