|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.utilities.AbstractVisitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint>
org.eclipse.ocl.examples.impactanalyzer.filterSynthesis.FilterSynthesisImpl
public class FilterSynthesisImpl
Collects the relevant events for a single OCLExpression recursively. 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 OCLExpression. In those cases, some framework may be responsible
for the initial evaluation of those OCLExpressions on new element, and therefore, context element creation events
are not of interest.
| Field Summary | |
|---|---|
protected java.util.Map<org.eclipse.emf.ecore.EReference,java.util.Set<NavigationCallExp>> |
associationEndCallExpressions
|
protected java.util.Set<EventFilter> |
filters
For each OCLExpression analyzed, stores the filters to merge into the resulting filter |
| Fields inherited from class org.eclipse.ocl.utilities.AbstractVisitor |
|---|
result |
| Constructor Summary | |
|---|---|
FilterSynthesisImpl(OCLExpression expression,
boolean notifyNewContextElements,
OCL ocl)
|
|
| Method Summary | |
|---|---|
java.util.Set<OperationCallExp> |
getAllInstancesCallsFor(org.eclipse.emf.ecore.EClassifier c)
Always returns a non-null set. |
java.util.Set<NavigationCallExp> |
getAssociationEndCallExpressions(org.eclipse.emf.ecore.EReference a)
Always returns a non-null set |
java.util.Set<PropertyCallExp> |
getAttributeCallExpressions(org.eclipse.emf.ecore.EAttribute a)
Always returns a non-null set |
OCLExpression |
getBodyForCall(OperationCallExp call)
Looks up if the OCLExpression that is called by the given OperationCallExp has already been visited. |
java.util.Set<OperationCallExp> |
getCallsOf(OCLExpression operationBodyExpression)
Returns all the calls to the operation whose body is operationBodyExpression that are reachable from the root expression analyzed by this FilterSynthesis. |
java.util.Map<OCLExpression,java.util.Set<PropertyCallExp>> |
getDerivedProperties()
|
OCLExpression |
getOperationBody(org.eclipse.emf.ecore.EOperation operation)
Determines the body expression of an operation |
java.util.Set<Variable> |
getParameterVariablesUsedInBody(OCLExpression body)
Determines the self variable as used by the operation body body. |
java.util.Set<Variable> |
getSelfVariablesUsedInBody(OCLExpression body)
Determines the self variables as used by the operation body or top-level non-operation-body (e.g., invariant)
expression body. |
EventFilter |
getSynthesisedFilter()
Obtains the event filter for the expression passed to the constructor. |
org.eclipse.emf.ecore.EPackage |
handleOperationCallExp(OperationCallExp<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation> opCallExp,
org.eclipse.emf.ecore.EPackage sourceResult,
java.util.List<org.eclipse.emf.ecore.EPackage> qualifierResults)
Visits the specified operation call with the results of visiting its source and arguments (if any). |
org.eclipse.emf.ecore.EPackage |
handleOppositePropertyCallExp(OppositePropertyCallExp callExp,
org.eclipse.emf.ecore.EPackage sourceResult)
|
org.eclipse.emf.ecore.EPackage |
handlePropertyCallExp(PropertyCallExp<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EStructuralFeature> propCallExp,
org.eclipse.emf.ecore.EPackage sourceResult,
java.util.List<org.eclipse.emf.ecore.EPackage> qualifierResults)
Visits the specified property call with the results of visiting its source and qualifiers (if any). |
org.eclipse.emf.ecore.EPackage |
visitOppositePropertyCallExp(OppositePropertyCallExp callExp)
Visits the property-call source and then its qualifiers (if any). |
org.eclipse.emf.ecore.EPackage |
visitVariableExp(VariableExp<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EParameter> var)
Simply returns AbstractVisitor.result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Set<EventFilter> filters
OCLExpression analyzed, stores the filters to merge into the resulting filter
protected final java.util.Map<org.eclipse.emf.ecore.EReference,java.util.Set<NavigationCallExp>> associationEndCallExpressions
| Constructor Detail |
|---|
public FilterSynthesisImpl(OCLExpression expression,
boolean notifyNewContextElements,
OCL ocl)
expression - The OCLExpression the filter should be created for.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.| Method Detail |
|---|
public org.eclipse.emf.ecore.EPackage handlePropertyCallExp(PropertyCallExp<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EStructuralFeature> propCallExp,
org.eclipse.emf.ecore.EPackage sourceResult,
java.util.List<org.eclipse.emf.ecore.EPackage> qualifierResults)
AbstractVisitorsourceResult will be null in that case.
- Overrides:
handlePropertyCallExp in class AbstractVisitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint>
- Parameters:
propCallExp - the property call expression, if there is a sourcesourceResult - the result of visiting the expression's sourcequalifierResults - the results of visiting the expression's
qualifiers, or an empty list if there are no qualifiers
- Returns:
- the accumulated
AbstractVisitor.result, by default - See Also:
AbstractVisitor.visitPropertyCallExp(PropertyCallExp)
public org.eclipse.emf.ecore.EPackage handleOperationCallExp(OperationCallExp<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation> opCallExp,
org.eclipse.emf.ecore.EPackage sourceResult,
java.util.List<org.eclipse.emf.ecore.EPackage> qualifierResults)
AbstractVisitor
handleOperationCallExp in class AbstractVisitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint>opCallExp - the operation call expressionsourceResult - the result of visiting the expression's sourcequalifierResults - the results of visiting the expression's
arguments, or an empty list if there are no arguments
AbstractVisitor.result, by defaultAbstractVisitor.visitOperationCallExp(OperationCallExp)public org.eclipse.emf.ecore.EPackage visitVariableExp(VariableExp<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EParameter> var)
AbstractVisitorAbstractVisitor.result.
visitVariableExp in interface Visitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint>visitVariableExp in class AbstractVisitor<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint>public java.util.Set<OperationCallExp> getCallsOf(OCLExpression operationBodyExpression)
FilterSynthesis. If no such calls exist, an empty set is returned.
getCallsOf in interface OperationBodyToCallMapperpublic EventFilter getSynthesisedFilter()
ImpactAnalyzer.getContextObjects(Notification).
public OCLExpression getBodyForCall(OperationCallExp call)
OCLExpression that is called by the given OperationCallExp has already been visited.
call - The OperationCallExp to look for
OCLExpression that defines the body of the called operationpublic java.util.Set<PropertyCallExp> getAttributeCallExpressions(org.eclipse.emf.ecore.EAttribute a)
public java.util.Set<NavigationCallExp> getAssociationEndCallExpressions(org.eclipse.emf.ecore.EReference a)
public java.util.Set<OperationCallExp> getAllInstancesCallsFor(org.eclipse.emf.ecore.EClassifier c)
public java.util.Set<Variable> getSelfVariablesUsedInBody(OCLExpression body)
OperationBodyToCallMapperself variables as used by the operation body or top-level non-operation-body (e.g., invariant)
expression body. While it might seem a little strange to have multiple self variables within the
same operation body, that's however what may happen in Ecore OCL. It would otherwise be tricky to identify the
self variable when given the body or the EOperation element. If self is not used by the
body, then null will be returned. Never returns null but may return an empty set.
getSelfVariablesUsedInBody in interface OperationBodyToCallMapperpublic java.util.Set<Variable> getParameterVariablesUsedInBody(OCLExpression body)
OperationBodyToCallMapperself variable as used by the operation body body. It would otherwise
be tricky to identify the self variable when given the body or the EOperation element. If
self is not used by the body, then null will be returned. Never returns null
but may return an empty set.
getParameterVariablesUsedInBody in interface OperationBodyToCallMapperpublic OCLExpression getOperationBody(org.eclipse.emf.ecore.EOperation operation)
OperationBodyToCallMapper
getOperationBody in interface OperationBodyToCallMapper
public org.eclipse.emf.ecore.EPackage handleOppositePropertyCallExp(OppositePropertyCallExp callExp,
org.eclipse.emf.ecore.EPackage sourceResult)
public org.eclipse.emf.ecore.EPackage visitOppositePropertyCallExp(OppositePropertyCallExp callExp)
AbstractVisitor.handlePropertyCallExp(PropertyCallExp, Object, List).
public java.util.Map<OCLExpression,java.util.Set<PropertyCallExp>> getDerivedProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||