Class InterfaceBuilder

java.lang.Object
org.somox.analyzer.simplemodelanalyzer.builder.AbstractBuilder
org.somox.analyzer.simplemodelanalyzer.builder.InterfaceBuilder

public class InterfaceBuilder extends AbstractBuilder
Builder used to create Interfaces in the SAMM instance based on reverse engineered code
  • Field Details

    • PROVIDED_INTERFACE

      public static final boolean PROVIDED_INTERFACE
      Constant indicating the case of a provided interface.
      See Also:
  • Constructor Details

    • InterfaceBuilder

      public InterfaceBuilder(Root gastModel, SoMoXConfiguration configuration, AnalysisResult result)
      Constructor of this interface builder
      Parameters:
      gastModel - GAST model used in queries to the source code
      configuration - Somox configuration used to retrieve settings
      result - The analysis result containing the root nodes of the models in which this builder will store the created model elements
  • Method Details

    • findAndAddRequiredInterfaces

      public boolean findAndAddRequiredInterfaces(ComponentImplementingClassesLink componentCandidate)
      Method used to find for a given component the set of required interfaces. Currently interfaces are detected using a IComponentInterfaceStrategy.
      Parameters:
      componentCandidate - The component for which this method should create required interfaces
      Returns:
      true if a interface was added; false else
    • addProvidedInterfaces

      public void addProvidedInterfaces(ComponentImplementingClassesLink componentCandidate)
      Create provided roles and their interfaces if they do not exist for the given component
      Parameters:
      componentCandidate - Source code annotation of the detected component for which the provided interfaces should be created. It has to point to a PrimitiveComponent.
    • updateRequiredInterfacesOfExistingPrimitiveComponents

      public void updateRequiredInterfacesOfExistingPrimitiveComponents()
      Updates the component interfaces of all interface existing until now in the source code decorator. The interfaces might have changed due to newly discovered interfaces during reverse engineering.
    • reverseEngineerRemainingInterfacesAsFreeFloatingInterfaces

      public void reverseEngineerRemainingInterfacesAsFreeFloatingInterfaces(AnalysisResult analysisResult, Root gastModel)
      Adds interfaces from the GAST which have not yet been identified as component interfaces to the SAMM repository.
      Parameters:
      analysisResult -
      gastModel -
    • removeInterfaceSelfAccesses

      public void removeInterfaceSelfAccesses(ComponentImplementingClassesLink primitiveComponent)
      Removes duplicate component interfaces which are provided AND required. Cleans ups the required interface ports. Since provided ports could be accessed from elsewhere, they are fully preserved.
      Parameters:
      primitiveComponent -