Class InterfaceBuilder
java.lang.Object
org.somox.analyzer.simplemodelanalyzer.builder.AbstractBuilder
org.somox.analyzer.simplemodelanalyzer.builder.InterfaceBuilder
Builder used to create
Interface
s in the SAMM instance based on reverse engineered code-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Constant indicating the case of a provided interface.Fields inherited from class org.somox.analyzer.simplemodelanalyzer.builder.AbstractBuilder
analysisResult, astModel, somoxConfiguration
-
Constructor Summary
ConstructorDescriptionInterfaceBuilder
(Root gastModel, SoMoXConfiguration configuration, AnalysisResult result) Constructor of this interface builder -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProvidedInterfaces
(ComponentImplementingClassesLink componentCandidate) Create provided roles and their interfaces if they do not exist for the given componentboolean
findAndAddRequiredInterfaces
(ComponentImplementingClassesLink componentCandidate) Method used to find for a given component the set of required interfaces.void
removeInterfaceSelfAccesses
(ComponentImplementingClassesLink primitiveComponent) Removes duplicate component interfaces which are provided AND required.void
reverseEngineerRemainingInterfacesAsFreeFloatingInterfaces
(AnalysisResult analysisResult, Root gastModel) Adds interfaces from the GAST which have not yet been identified as component interfaces to the SAMM repository.void
Updates the component interfaces of all interface existing until now in the source code decorator.
-
Field Details
-
PROVIDED_INTERFACE
public static final boolean PROVIDED_INTERFACEConstant indicating the case of a provided interface.- See Also:
-
-
Constructor Details
-
InterfaceBuilder
Constructor of this interface builder- Parameters:
gastModel
- GAST model used in queries to the source codeconfiguration
- Somox configuration used to retrieve settingsresult
- The analysis result containing the root nodes of the models in which this builder will store the created model elements
-
-
Method Details
-
findAndAddRequiredInterfaces
Method used to find for a given component the set of required interfaces. Currently interfaces are detected using aIComponentInterfaceStrategy
.- Parameters:
componentCandidate
- The component for which this method should create required interfaces- Returns:
- true if a interface was added; false else
-
addProvidedInterfaces
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 aPrimitiveComponent
.
-
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
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
-
-