Class JaMoPPStatementVisitor


public class JaMoPPStatementVisitor extends AbstractJaMoPPStatementVisitor
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.
  • 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 Uses DefaultInterfaceOfExternalCallFinder to find interfaces of external calls.
      Parameters:
      functionClassificationAnnotations - A map containing the type annotations for the nodes of the GAST model. Generated by a FunctionCallClassificationVisitor.
      resourceDemandingBehaviour - The RD-behaviour to generate
      sourceCodeDecorator - 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 class AbstractJaMoPPStatementVisitor
      Parameters:
      loopStatement - the loop statement
      body - the body of the loop statement
      Returns:
    • handleSwitch

      protected Object handleSwitch(tools.mdsd.jamopp.model.java.statements.Switch switchStatement)
      Specified by:
      handleSwitch in class AbstractJaMoPPStatementVisitor
    • handleTryBlock

      protected Object handleTryBlock(tools.mdsd.jamopp.model.java.statements.TryBlock tryBlock)
      Specified by:
      handleTryBlock in class AbstractJaMoPPStatementVisitor
    • handleCondition

      protected Object handleCondition(tools.mdsd.jamopp.model.java.statements.Condition condition)
      Specified by:
      handleCondition in class AbstractJaMoPPStatementVisitor
    • 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 class AbstractJaMoPPStatementVisitor
    • foundInternalAction

      protected void foundInternalAction(tools.mdsd.jamopp.model.java.statements.Statement statement)
      Specified by:
      foundInternalAction in class AbstractJaMoPPStatementVisitor
    • 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 class AbstractJaMoPPStatementVisitor
    • 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 class AbstractJaMoPPStatementVisitor
    • 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 class AbstractJaMoPPStatementVisitor