|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ocl.examples.impactanalyzer.impl.ImpactAnalyzerImpl
public class ImpactAnalyzerImpl
Implementation of the ImpactAnalyzer
Constructor Summary | |
---|---|
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)
|
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.
notifyNewContextElements
- 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 queriesnotifyNewContextElements
- 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 queriesnotifyNewContextElements
- 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.Method Detail |
---|
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 for
null
public java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.ecore.EObject evaluationResult)
ImpactAnalyzer
#expression
managed by this instance scope analysis results in
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |