public class ImpactAnalyzerImpl extends java.lang.Object implements ImpactAnalyzer
ImpactAnalyzer
Constructor and Description |
---|
ImpactAnalyzerImpl(OCLExpression expression,
boolean notifyOnNewContextElements,
ActivationOption configuration,
OCLFactory oclFactory)
Creates a new impact analyzer for the OCL expression given.
|
ImpactAnalyzerImpl(OCLExpression expression,
boolean notifyOnNewContextElements,
OppositeEndFinder oppositeEndFinder,
ActivationOption configuration,
OCLFactory oclFactory) |
ImpactAnalyzerImpl(OCLExpression expression,
org.eclipse.emf.ecore.EClass context,
boolean notifyOnNewContextElements,
ActivationOption configuration,
OCLFactory oclFactory) |
ImpactAnalyzerImpl(OCLExpression expression,
org.eclipse.emf.ecore.EClass context,
boolean notifyOnNewContextElements,
OppositeEndFinder oppositeEndFinder,
ActivationOption configuration,
OCLFactory oclFactory) |
Modifier and Type | Method and Description |
---|---|
protected ContextTypeRetriever |
createContextTypeRetriever() |
EventFilter |
createFilterForExpression()
Creates a filter for the given OCL expression, which matches at least all events
that cause the expression to change its value on one or more context elements.
|
protected FilterSynthesisImpl |
createFilterSynthesis(OCLExpression expression,
boolean notifyOnNewContextElements,
OCL ocl) |
protected InstanceScopeAnalysis |
createInstanceScopeAnalysis() |
java.util.Collection<org.eclipse.emf.ecore.EObject> |
getContextObjects(org.eclipse.emf.ecore.EObject evaluationResult)
Determines a superset of the set of context objects for which the overall
expression managed by this instance scope analysis results in
evaluationResult or a collection containing
evaluationResult . |
java.util.Collection<org.eclipse.emf.ecore.EObject> |
getContextObjects(org.eclipse.emf.common.notify.Notification event)
For a change notification event calculates a superset of the set of context objects
for which expression may have changed its value due to the change indicated by the event.
|
protected OCLExpression |
getExpression() |
public ImpactAnalyzerImpl(OCLExpression expression, boolean notifyOnNewContextElements, ActivationOption configuration, OCLFactory oclFactory)
createFilterForExpression()
) no context type is required. Should getContextObjects(Notification)
be called later, a context type may be needed. When this constructor is used, it is inferred on demand using the
ContextTypeRetriever
, visiting all subexpressions looking for self
occurrences and picking their type.
Should you conveniently have the context type available, consider using
ImpactAnalyzerImpl(OCLExpression, EClass, boolean, ActivationOption, OCLFactory)
instead.
notifyOnNewContextElements
- The analyzer can be parameterized during construction such that it either registers for creation events on the
context type or not. Registering for element creation on the context type is useful for invariants / constraints
because when a new element is created, validating the constraint may be useful. For other use cases, registering
for element creation may not be so useful. For example, when a type inferencer defines its rules using OCL, it
only wants to receive update events after the element has been fully initialized from those OCL
expressions. In those cases, some framework may be responsible for the initial evaluation of those OCL
expressions on new element, and therefore, context element creation events are not of interest.public ImpactAnalyzerImpl(OCLExpression expression, org.eclipse.emf.ecore.EClass context, boolean notifyOnNewContextElements, ActivationOption configuration, OCLFactory oclFactory)
public ImpactAnalyzerImpl(OCLExpression expression, boolean notifyOnNewContextElements, OppositeEndFinder oppositeEndFinder, ActivationOption configuration, OCLFactory oclFactory)
oppositeEndFinder
- used during partial navigation and for metamodel queriesnotifyOnNewContextElements
- The analyzer can be parameterized during construction such that it either registers for creation events on the
context type or not. Registering for element creation on the context type is useful for invariants / constraints
because when a new element is created, validating the constraint may be useful. For other use cases, registering
for element creation may not be so useful. For example, when a type inferencer defines its rules using OCL, it
only wants to receive update events after the element has been fully initialized from those OCL
expressions. In those cases, some framework may be responsible for the initial evaluation of those OCL
expressions on new element, and therefore, context element creation events are not of interest.public ImpactAnalyzerImpl(OCLExpression expression, org.eclipse.emf.ecore.EClass context, boolean notifyOnNewContextElements, OppositeEndFinder oppositeEndFinder, ActivationOption configuration, OCLFactory oclFactory)
oppositeEndFinder
- used during partial navigation and for metamodel queriesnotifyOnNewContextElements
- The analyzer can be parameterized during construction such that it either registers for creation events on the
context type or not. Registering for element creation on the context type is useful for invariants / constraints
because when a new element is created, validating the constraint may be useful. For other use cases, registering
for element creation may not be so useful. For example, when a type inferencer defines its rules using OCL, it
only wants to receive update events after the element has been fully initialized from those OCL
expressions. In those cases, some framework may be responsible for the initial evaluation of those OCL
expressions on new element, and therefore, context element creation events are not of interest.protected ContextTypeRetriever createContextTypeRetriever()
public EventFilter createFilterForExpression()
ImpactAnalyzer
createFilterForExpression
in interface ImpactAnalyzer
protected FilterSynthesisImpl createFilterSynthesis(OCLExpression expression, boolean notifyOnNewContextElements, OCL ocl)
public java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.common.notify.Notification event)
ImpactAnalyzer
getContextObjects
in interface ImpactAnalyzer
event
- the event to calculate fornull
public java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.ecore.EObject evaluationResult)
ImpactAnalyzer
evaluationResult
or a collection containing
evaluationResult
. The result is always a valid collection,
never null
, but possibly empty.getContextObjects
in interface ImpactAnalyzer
evaluationResult
- has to be a non-null
EObject
because
backwards navigation is not easily possible for
primitive-typed values and is impossible from
null
values for now.protected InstanceScopeAnalysis createInstanceScopeAnalysis()
protected OCLExpression getExpression()