Class ComponentBuilder

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

public class ComponentBuilder extends AbstractBuilder
Builder for SAMM structures. Takes care of updating the source code decorator. The core builder facility.
  • Constructor Details

    • ComponentBuilder

      public ComponentBuilder(Root gastModel, SoMoXConfiguration somoxConfiguration, AnalysisResult analysisResult)
      Main builder used to create model elements of the SAMM during component detection with SoMoX.
      Parameters:
      gastModel - The GAST model containing the analyzed source code
      somoxConfiguration - SoMoX configuration object
      analysisResult - Object holding the root elements of the models to create
  • Method Details

    • createCompositeComponent

      public ComponentImplementingClassesLink createCompositeComponent(org.jgrapht.Graph<ComponentImplementingClassesLink,ClusteringRelation> compositeComponentSubgraph)
      Compose case. Method to create a new composite component. The new composite component will contain the components referenced by the list of innerComponents as sub-components.
      Parameters:
      compositeComponentSubgraph - Already detected components that should become the subcomponent instances of the new composite component
      Returns:
      The ComponentImplementingClassesLink annotation describing the new composite component and its code origin
    • createAssemblyContext

      public List<org.palladiosimulator.pcm.core.composition.AssemblyContext> createAssemblyContext(Set<ComponentImplementingClassesLink> subComponents, org.palladiosimulator.pcm.core.composition.ComposedStructure newComponentType)
      Create subcomponent instances for the components
      Parameters:
      subComponents - Inner Components for which to create the instances
      newComponentType - The outer component for which to add the instances
      Returns:
      created subcomponent instances
    • createMergedComponent

      public ComponentImplementingClassesLink createMergedComponent(org.jgrapht.Graph<ComponentImplementingClassesLink,ClusteringRelation> compositeComponentSubgraph)
      Merge case. Creates a new primitive component: either as subcomponent of a given composite component or as a separate primitive component.
      Parameters:
      compositeComponentSubgraph - if composite component contained: The primitive component becomes child of this component.
      Returns:
      Existing composite with children or new primitive component
    • createPrimitiveComponentFromGASTClass

      public ComponentImplementingClassesLink createPrimitiveComponentFromGASTClass(tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier gastClass)
      Method to create a primitive component, its source decoration and its provided and required interfaces. The primitive component generated contains the given GASTClass plus all inner classes of that GASTClass as its implementation.
      Parameters:
      gastClass - The main GASTClass for which a new primitive component is being created
      Returns:
      The ComponentImplementingClassesLink annotation describing the new component and its origin in the source code
    • createSinglePrimitiveComponentFromGASTClasses

      public ComponentImplementingClassesLink createSinglePrimitiveComponentFromGASTClasses(List<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> gastClasses)
      Create a NEW single large primitive component (SAMM and Class link) comprising multiple classes. Method to create a primitive component, its source decoration and its provided and required interfaces. The primitive component generated contains the given GASTClass plus all inner classes of that GASTClass as its implementation.
      Parameters:
      gastClasses - The main GASTClasses for which a new primitive component is being created
      Returns:
      The ComponentImplementingClassesLink annotation describing the new component and its origin in the source code
    • createSinglePrimitiveComponentFromGASTClasses

      public ComponentImplementingClassesLink createSinglePrimitiveComponentFromGASTClasses(List<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> gastClasses, ComponentImplementingClassesLink primitiveComponent)
      Create a new single large SAMM primitive component comprising multiple classes using an existing class link. Method to create a primitive component, its source decoration and its provided and required interfaces. The primitive component generated contains the given GASTClass plus all inner classes of that GASTClass as its implementation.
      Parameters:
      gastClasses - The main GASTClasses for which a new primitive component is being created
      primitiveComponent - Existing component link for which to add the SAMM component
      Returns:
      The ComponentImplementingClassesLink annotation describing the new component and its origin in the source code
    • createComponentLinkFromGASTClass

      public ComponentImplementingClassesLink createComponentLinkFromGASTClass(tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier gastClass)
      Create a component link from a GAST class only. Attention: Does not create the SAMM component! Only sets the gast class.
      Parameters:
      gastClass - The main GASTClass for which a component link is being created
      Returns:
      The ComponentImplementingClassesLink annotation describing the new component link and its origin in the source code
    • 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.
    • getInterfaceBuilder

      public InterfaceBuilder getInterfaceBuilder()
    • getComponentAndTypeNamingStrategy

      public ComponentAndTypeNaming getComponentAndTypeNamingStrategy()
    • getInsideCompositeComponentAssemblyConnectorStrategy

      public IAssemblyConnectorStrategy getInsideCompositeComponentAssemblyConnectorStrategy()