|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.impactanalyzer.deltaPropagation.PartialEvaluatorFactoryImpl
org.eclipse.ocl.examples.impactanalyzer.instanceScope.InstanceScopeAnalysis
public class InstanceScopeAnalysis
Supports a lookup from a source model element of either an attribute value change event or a link add/remove event together
with an OCLExpression to a set of context objects for which the expression may return a value different
from the one it returned before the change event occurred. An instance of this class manages the analysis for all expression
occuring within one root OCL expression, including the expressions reachable in operation body expressions where the operation
may be called directly of indirectly by the root expression.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.ocl.examples.impactanalyzer.PartialEvaluatorFactory |
|---|
INSTANCE |
| Constructor Summary | |
|---|---|
|
InstanceScopeAnalysis(OCLExpression expression,
org.eclipse.emf.ecore.EClass exprContext,
FilterSynthesisImpl filterSynthesizer,
OppositeEndFinder oppositeEndFinder,
ActivationOption configuration,
OCLFactory oclFactory)
|
protected |
InstanceScopeAnalysis(OCLExpression expression,
org.eclipse.emf.ecore.EClass exprContext,
FilterSynthesisImpl filterSynthesizer,
OppositeEndFinder oppositeEndFinder,
PartialEvaluatorImpl partialEvaluator,
ActivationOption configuration,
OCLFactory oclFactory,
PathCache pathCache,
TracebackStepCache tracebackStepCache)
|
| Method Summary | |
|---|---|
protected Tracer |
createTracer(OCLExpression expression,
java.util.Stack<java.lang.String> tuplePartNames,
OCLFactory oclFactory)
Factory method that creates an instance of some Tracer-implementing class specific to the type of the OCL
expression. |
static java.util.Set<org.eclipse.emf.ecore.EObject> |
getAllPossibleContextInstances(org.eclipse.emf.common.notify.Notifier context,
org.eclipse.emf.ecore.EClass cls,
OppositeEndFinder oppositeEndFinder)
Finds all elements of type cls or conforming to cls such that based on the scope definition
implemented by the oppositeEndFinder's
OppositeEndFinder.getAllInstancesSeeing(EClass, org.eclipse.emf.common.notify.Notifier) method, the elements
returned can "see" container. |
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,
boolean notifyOnNewContextElements)
|
PartialEvaluatorFactory |
getPartialEvaluatorFactory()
|
protected PartialEvaluatorImpl |
getPartialEvaluatorForAllInstancesDeltaPropagation()
|
protected PathCache |
getPathCache()
|
protected java.util.Collection<AnnotatedEObject> |
getSourceElement(org.eclipse.emf.common.notify.Notification changeEvent,
NavigationCallExp attributeOrAssociationEndCall)
|
protected java.util.Collection<java.lang.Object> |
getSourceElementsForOppositePropertyCallExp(org.eclipse.emf.common.notify.Notification changeEvent)
|
protected void |
initInstanceScopeAnalysisOnPathCache()
|
boolean |
isUnaffectedDueToPrimitiveAttributeValueComparisonWithLiteralOnly(org.eclipse.emf.common.notify.Notification changeEvent,
java.lang.String replacementFor__TEMP__)
Checks if all ModelChangeEvents contained in events are attribute changes and the expressions affected by
the change event are all attribute call expressions for an attribute of primitive type that is used in a direct comparison
with a constant literal. |
| Methods inherited from class org.eclipse.ocl.examples.impactanalyzer.deltaPropagation.PartialEvaluatorFactoryImpl |
|---|
createPartialEvaluator, createPartialEvaluator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InstanceScopeAnalysis(OCLExpression expression,
org.eclipse.emf.ecore.EClass exprContext,
FilterSynthesisImpl filterSynthesizer,
OppositeEndFinder oppositeEndFinder,
ActivationOption configuration,
OCLFactory oclFactory)
expression - the OCL expression for which to perform instance scope impact analysisoppositeEndFinder - used during partial evaluation and for metamodel queries, e.g., finding opposite role names, or finding all
subclasses of a class; as well as for obtaining all instances of a type while performing an
AllInstancesNavigationStep. It is handed to the PathCache object from where
Tracers can retrieve it using AbstractPathCache.getOppositeEndFinder().
protected InstanceScopeAnalysis(OCLExpression expression,
org.eclipse.emf.ecore.EClass exprContext,
FilterSynthesisImpl filterSynthesizer,
OppositeEndFinder oppositeEndFinder,
PartialEvaluatorImpl partialEvaluator,
ActivationOption configuration,
OCLFactory oclFactory,
PathCache pathCache,
TracebackStepCache tracebackStepCache)
| Method Detail |
|---|
protected void initInstanceScopeAnalysisOnPathCache()
protected PathCache getPathCache()
public static java.util.Set<org.eclipse.emf.ecore.EObject> getAllPossibleContextInstances(org.eclipse.emf.common.notify.Notifier context,
org.eclipse.emf.ecore.EClass cls,
OppositeEndFinder oppositeEndFinder)
cls or conforming to cls such that based on the scope definition
implemented by the oppositeEndFinder's
OppositeEndFinder.getAllInstancesSeeing(EClass, org.eclipse.emf.common.notify.Notifier) method, the elements
returned can "see" container.
cls - the overall context type for the entire expression; this context type defines the type for self if used
outside of operation bodies.oppositeEndFinder - used to determine all instances
protected Tracer createTracer(OCLExpression expression,
java.util.Stack<java.lang.String> tuplePartNames,
OCLFactory oclFactory)
Tracer-implementing class specific to the type of the OCL
expression.
caller - the calling tracer from which the list of tuple part names to look for are copied
unchanged to the new tracer created by this operation. May be null in which case the
new tracer does not look for any tuple literal parts initially.
public java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.common.notify.Notification event,
boolean notifyOnNewContextElements)
public java.util.Collection<org.eclipse.emf.ecore.EObject> getContextObjects(org.eclipse.emf.ecore.EObject evaluationResult)
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.
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.
public boolean isUnaffectedDueToPrimitiveAttributeValueComparisonWithLiteralOnly(org.eclipse.emf.common.notify.Notification changeEvent,
java.lang.String replacementFor__TEMP__)
ModelChangeEvents contained in events are attribute changes and the expressions affected by
the change event are all attribute call expressions for an attribute of primitive type that is used in a direct comparison
with a constant literal. If this is the case, compares the old and new value with the literal's value, considering the
comparison operator. If no change occurs in comparison result for any of the events, true is returned because then
the expression value didn't change based on the change event. If any of the events is an event of different type or the
attribute is not of primitive type or its value is not compared to a constant, false is returned.
Note that further performance improvements are conceivable but not yet implemented. For example, the attribute call expression may be used in a let-expression and then the variable may be compared to a primitive literal.
replacementFor__TEMP__ - as a special case, expressions can contain the special string literal "__TEMP__" (see
GlobalDelayedReferenceResolver.TEMPORARY_QUERY_PARAM_REPLACEMENT). Those will be replaced by the value of a
lexical token. This value can be passed here so that the comparison does not happen with the special "__TEMP__"
constant but with the parameter value instead in case the comparison argument is a string literal with value
"__TEMP__".
protected java.util.Collection<AnnotatedEObject> getSourceElement(org.eclipse.emf.common.notify.Notification changeEvent,
NavigationCallExp attributeOrAssociationEndCall)
changeEvent - either an AttributeValueChangeEvent or a LinkChangeEvent.attributeOrAssociationEndCall - a (sub-)expression originally affected by changeEvent. For LinkChangeEvents it depends on which
end the expression uses what will be considered the source element of the change which will then be returned by
this method. The source is the element at the end of the link changed that is the opposite end of the end used
by the AssociationEndCallExp. attributeOrAssociationEndCall has to be of type
AttributeCallExp in case changeEvent is an AttributeValueChangeEvent, and of type
AssociationEndCallExp in case changeEvent is of type LinkChangeEvent.
protected java.util.Collection<java.lang.Object> getSourceElementsForOppositePropertyCallExp(org.eclipse.emf.common.notify.Notification changeEvent)
protected PartialEvaluatorImpl getPartialEvaluatorForAllInstancesDeltaPropagation()
public PartialEvaluatorFactory getPartialEvaluatorFactory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||