Package org.somox.gast2seff.visitors
Class JaMoPPStatementVisitor
java.lang.Object
org.eclipse.emf.ecore.util.Switch<T>
org.eclipse.emf.ecore.util.ComposedSwitch<Object>
org.somox.gast2seff.visitors.AbstractJaMoPPStatementVisitor
org.somox.gast2seff.visitors.JaMoPPStatementVisitor
A visitor which traverses a GAST behaviour and creates a SEFF matching the
traversed behaviour. The generated SEFF is abstracted based on a
classification of the GAST statements into external and internal service
calls.
functionClassificationAnnotation
classifies which elements to
hold when traversing the GAST behaviour.-
Field Summary
Fields inherited from class org.somox.gast2seff.visitors.AbstractJaMoPPStatementVisitor
doNotSkipNextStatement, functionClassificationAnnotation, lastType, methodCallFinder
-
Constructor Summary
ConstructorDescriptionJaMoPPStatementVisitor
(Map<tools.mdsd.jamopp.model.java.commons.Commentable, List<BitSet>> functionClassificationAnnotations, org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour resourceDemandingBehaviour, SourceCodeDecoratorRepository sourceCodeDecorator, org.palladiosimulator.pcm.repository.BasicComponent primitiveComponent, InterfaceOfExternalCallFindingFactory interfaceOfExternalCallFinderFactory, ResourceDemandingBehaviourForClassMethodFinding resourceDemandingBehaviourForClassMethodFinding, MethodCallFinder methodCallFinder) JaMoPPStatementVisitor
(Map<tools.mdsd.jamopp.model.java.commons.Commentable, List<BitSet>> functionClassificationAnnotations, org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour resourceDemandingBehaviour, SourceCodeDecoratorRepository sourceCodeDecorator, org.palladiosimulator.pcm.repository.BasicComponent primitiveComponent, MethodCallFinder methodCallFinder) Constructor UsesDefaultInterfaceOfExternalCallFinder
to find interfaces of external calls. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
foundEmitEventAction
(tools.mdsd.jamopp.model.java.statements.Statement statement, tools.mdsd.jamopp.model.java.members.Method calledMethod, BitSet statementAnnotation) The method is if an emit event action has been found.protected void
foundExternalCall
(tools.mdsd.jamopp.model.java.statements.Statement object, tools.mdsd.jamopp.model.java.members.Method calledMethod, BitSet statementAnnotation) protected void
foundInternalAction
(tools.mdsd.jamopp.model.java.statements.Statement statement) protected Object
handleClassMethod
(tools.mdsd.jamopp.model.java.members.ClassMethod classMethod, tools.mdsd.jamopp.model.java.statements.Statement callStatement) If resourceDemandingBehaviourForClassMethodFinding is not set we handle the class method like any other statement list container.protected Object
handleCondition
(tools.mdsd.jamopp.model.java.statements.Condition condition) protected Object
handleLoopStatement
(tools.mdsd.jamopp.model.java.statements.Statement loopStatement, tools.mdsd.jamopp.model.java.statements.Statement body) Handles loop statement.protected Object
handleSwitch
(tools.mdsd.jamopp.model.java.statements.Switch switchStatement) protected Object
handleSynchronizedBlock
(tools.mdsd.jamopp.model.java.statements.SynchronizedBlock synchronizedBlock) Per default we do not handle synchronized blocks.protected Object
handleTryBlock
(tools.mdsd.jamopp.model.java.statements.TryBlock tryBlock) Methods inherited from class org.somox.gast2seff.visitors.AbstractJaMoPPStatementVisitor
containsExternalCall, defaultCase, handleFormerSimpleStatement, handleStatementListContainer, isEmitEventCall, isExternalCall, isInternalCall, isInternalCallContainingExternalCall, isLibraryCall, isVisitedStatement, positionToLineNumber, positionToString, setVisited, shouldSkip
Methods inherited from class org.eclipse.emf.ecore.util.ComposedSwitch
addSwitch, delegatedDoSwitch, doSwitch, findDelegate, isSwitchFor, removeSwitch
-
Constructor Details
-
JaMoPPStatementVisitor
public JaMoPPStatementVisitor(Map<tools.mdsd.jamopp.model.java.commons.Commentable, List<BitSet>> functionClassificationAnnotations, org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour resourceDemandingBehaviour, SourceCodeDecoratorRepository sourceCodeDecorator, org.palladiosimulator.pcm.repository.BasicComponent primitiveComponent, MethodCallFinder methodCallFinder) Constructor UsesDefaultInterfaceOfExternalCallFinder
to find interfaces of external calls.- Parameters:
functionClassificationAnnotations
- A map containing the type annotations for the nodes of the GAST model. Generated by aFunctionCallClassificationVisitor
.resourceDemandingBehaviour
- The RD-behaviour to generatesourceCodeDecorator
- The gast behaviour which maps gast statements and SAMM repository.primitiveComponent
-
-
JaMoPPStatementVisitor
public JaMoPPStatementVisitor(Map<tools.mdsd.jamopp.model.java.commons.Commentable, List<BitSet>> functionClassificationAnnotations, org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour resourceDemandingBehaviour, SourceCodeDecoratorRepository sourceCodeDecorator, org.palladiosimulator.pcm.repository.BasicComponent primitiveComponent, InterfaceOfExternalCallFindingFactory interfaceOfExternalCallFinderFactory, ResourceDemandingBehaviourForClassMethodFinding resourceDemandingBehaviourForClassMethodFinding, MethodCallFinder methodCallFinder)
-
-
Method Details
-
handleLoopStatement
protected Object handleLoopStatement(tools.mdsd.jamopp.model.java.statements.Statement loopStatement, tools.mdsd.jamopp.model.java.statements.Statement body) Handles loop statement. In the SISSy metamodel there was only one metamodel element, in the JaMoPP Java there are three.- Specified by:
handleLoopStatement
in classAbstractJaMoPPStatementVisitor
- Parameters:
loopStatement
- the loop statementbody
- the body of the loop statement- Returns:
-
handleSwitch
- Specified by:
handleSwitch
in classAbstractJaMoPPStatementVisitor
-
handleTryBlock
- Specified by:
handleTryBlock
in classAbstractJaMoPPStatementVisitor
-
handleCondition
- Specified by:
handleCondition
in classAbstractJaMoPPStatementVisitor
-
handleClassMethod
protected Object handleClassMethod(tools.mdsd.jamopp.model.java.members.ClassMethod classMethod, tools.mdsd.jamopp.model.java.statements.Statement callStatement) If resourceDemandingBehaviourForClassMethodFinding is not set we handle the class method like any other statement list container. If resourceDemandingBehaviourForClassMethodFinding is set to a ResourceDemandingInternalBehaviour for the class method will be created (if not created yet) in the current method and called from the current SEFF. In the current SEFF an InternalCallAction will be created that calls the ResourceDemandingInternalBehaviour. If classMethod already has an SEFF that can be called from outside the component a InternalCallAction is created that just calls the SEFF- Specified by:
handleClassMethod
in classAbstractJaMoPPStatementVisitor
-
foundInternalAction
protected void foundInternalAction(tools.mdsd.jamopp.model.java.statements.Statement statement) - Specified by:
foundInternalAction
in classAbstractJaMoPPStatementVisitor
-
foundExternalCall
protected void foundExternalCall(tools.mdsd.jamopp.model.java.statements.Statement object, tools.mdsd.jamopp.model.java.members.Method calledMethod, BitSet statementAnnotation) - Specified by:
foundExternalCall
in classAbstractJaMoPPStatementVisitor
-
foundEmitEventAction
protected void foundEmitEventAction(tools.mdsd.jamopp.model.java.statements.Statement statement, tools.mdsd.jamopp.model.java.members.Method calledMethod, BitSet statementAnnotation) Description copied from class:AbstractJaMoPPStatementVisitor
The method is if an emit event action has been found. As we are currently not able to deal with emit event actions and in order to achieve backwards compatibility, we provide a default implementation that treats the calls as library calls.- Overrides:
foundEmitEventAction
in classAbstractJaMoPPStatementVisitor
-
handleSynchronizedBlock
protected Object handleSynchronizedBlock(tools.mdsd.jamopp.model.java.statements.SynchronizedBlock synchronizedBlock) Description copied from class:AbstractJaMoPPStatementVisitor
Per default we do not handle synchronized blocks. Instead we treat the synchronized statement like any other statement. It is, however, up to subclasses to override this method and handle synchronized blocks.- Overrides:
handleSynchronizedBlock
in classAbstractJaMoPPStatementVisitor
-