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
ConstructorsConstructorDescriptionJaMoPPStatementVisitor(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 UsesDefaultInterfaceOfExternalCallFinderto find interfaces of external calls. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfoundEmitEventAction(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 voidfoundExternalCall(tools.mdsd.jamopp.model.java.statements.Statement object, tools.mdsd.jamopp.model.java.members.Method calledMethod, BitSet statementAnnotation) protected voidfoundInternalAction(tools.mdsd.jamopp.model.java.statements.Statement statement) protected ObjecthandleClassMethod(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 ObjecthandleCondition(tools.mdsd.jamopp.model.java.statements.Condition condition) protected ObjecthandleLoopStatement(tools.mdsd.jamopp.model.java.statements.Statement loopStatement, tools.mdsd.jamopp.model.java.statements.Statement body) Handles loop statement.protected ObjecthandleSwitch(tools.mdsd.jamopp.model.java.statements.Switch switchStatement) protected ObjecthandleSynchronizedBlock(tools.mdsd.jamopp.model.java.statements.SynchronizedBlock synchronizedBlock) Per default we do not handle synchronized blocks.protected ObjecthandleTryBlock(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, shouldSkipMethods 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 UsesDefaultInterfaceOfExternalCallFinderto 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:
handleLoopStatementin classAbstractJaMoPPStatementVisitor- Parameters:
loopStatement- the loop statementbody- the body of the loop statement- Returns:
-
handleSwitch
- Specified by:
handleSwitchin classAbstractJaMoPPStatementVisitor
-
handleTryBlock
- Specified by:
handleTryBlockin classAbstractJaMoPPStatementVisitor
-
handleCondition
- Specified by:
handleConditionin 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:
handleClassMethodin classAbstractJaMoPPStatementVisitor
-
foundInternalAction
protected void foundInternalAction(tools.mdsd.jamopp.model.java.statements.Statement statement) - Specified by:
foundInternalActionin 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:
foundExternalCallin 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:AbstractJaMoPPStatementVisitorThe 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:
foundEmitEventActionin classAbstractJaMoPPStatementVisitor
-
handleSynchronizedBlock
protected Object handleSynchronizedBlock(tools.mdsd.jamopp.model.java.statements.SynchronizedBlock synchronizedBlock) Description copied from class:AbstractJaMoPPStatementVisitorPer 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:
handleSynchronizedBlockin classAbstractJaMoPPStatementVisitor
-