Interface IBaseCoreAccess

All Superinterfaces:
IElementAccess, INamedElementAccess
All Known Subinterfaces:
IPluginCoreAccess, IPluginLanguageBasedAccess

public interface IBaseCoreAccess extends INamedElementAccess
Parent interface for plugins extending the functionality of Sonargraph by accessing the parser model.
  • Method Details

    • getBaseDirectory

      File getBaseDirectory()
    • getBaseDirectoryPath

      String getBaseDirectoryPath()
    • getName

      String getName()
      Return name of software system
      Specified by:
      getName in interface IElementAccess
      Returns:
      Name of software system
    • getComponents

      List<IComponentAccess> getComponents()
      Gets a list of all components of the software system
      Returns:
      Component list
    • getComponents

      List<IComponentAccess> getComponents(boolean includeExternals)
      Gets a list of all components of the software system
      Parameters:
      if - false, only internal components will be returned
      Returns:
      Component list
    • getModules

      List<IModuleAccess> getModules()
      Get a list of the modules in this system
      Returns:
      Module list
    • getExternalRoot

      IExternalAccess getExternalRoot(String forLanguage)
      Get the external root node for a given language
      Parameters:
      forLanguage - Language (as of now "Java", "C#" or "C,C++")
      Returns:
      the external root for the given language or null if it does not exist.
    • findElementByFqn

      IElementAccess findElementByFqn(String fqn)
      Find an element by its fully qualified name
      Parameters:
      fqn - The fully qualified name of the element (to be found in Sonargraph properties view). Must not be null, empty or contain only whitespace.
      Returns:
      The element or null, if no element with that fully qualified name can be found.
    • findFirstMatchingType

      ITypeAccess findFirstMatchingType(INamedElementAccess searchRoot, Predicate<ITypeAccess> predicate)
      Find first type matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the type.
      Returns:
      The matching type or null if there is no matching type.
    • findAllMatchingTypes

      List<ITypeAccess> findAllMatchingTypes(INamedElementAccess searchRoot, Predicate<ITypeAccess> predicate)
      Find all types matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the types.
      Returns:
      A list of types matching the predicate (can be empty).
    • findFirstMatchingMethod

      IMethodAccess findFirstMatchingMethod(INamedElementAccess searchRoot, Predicate<IMethodAccess> predicate)
      Find first method matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the method.
      Returns:
      The matching type or null if there is no matching method.
    • findAllMatchingMethods

      List<IMethodAccess> findAllMatchingMethods(INamedElementAccess searchRoot, Predicate<IMethodAccess> predicate)
      Find all methods matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the methods.
      Returns:
      A list of methods matching the predicate (can be empty).
    • findFirstMatchingRoutine

      IRoutineAccess findFirstMatchingRoutine(INamedElementAccess searchRoot, Predicate<IRoutineAccess> predicate)
      Find first type routine the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the routine.
      Returns:
      The matching type or null if there is no matching routine.
    • findAllMatchingRoutines

      List<IRoutineAccess> findAllMatchingRoutines(INamedElementAccess searchRoot, Predicate<IRoutineAccess> predicate)
      Find all routines matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the routines.
      Returns:
      A list of routines matching the predicate (can be empty).
    • findFirstMatchingField

      IFieldAccess findFirstMatchingField(INamedElementAccess searchRoot, Predicate<IFieldAccess> predicate)
      Find first field matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the field.
      Returns:
      The matching field or null if there is no matching field.
    • findAllMatchingFields

      List<IFieldAccess> findAllMatchingFields(INamedElementAccess searchRoot, Predicate<IFieldAccess> predicate)
      Find all fields matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the fields.
      Returns:
      A list of fields matching the predicate (can be empty).
    • findFirstMatchingElement

      INamedElementAccess findFirstMatchingElement(INamedElementAccess searchRoot, Predicate<INamedElementAccess> predicate)
      Find first element matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the element.
      Returns:
      The matching element or null if there is no matching element.
    • findFirstMatchingElementRecursively

      INamedElementAccess findFirstMatchingElementRecursively(INamedElementAccess searchRoot, Predicate<INamedElementAccess> predicate)
      Recursively find first element matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched.
      predicate - The predicate to match the element, must not be null.
      Returns:
      The matching element or null if there is no matching element.
    • findAllMatchingElements

      List<INamedElementAccess> findAllMatchingElements(INamedElementAccess searchRoot, Predicate<INamedElementAccess> predicate)
      Find all elements matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the element.
      Returns:
      A list of elements matching the predicate (can be empty).
    • findAllMatchingElementsRecursively

      List<INamedElementAccess> findAllMatchingElementsRecursively(INamedElementAccess searchRoot, Predicate<INamedElementAccess> predicate)
      Find all elements recursively, matching the predicate.
      Parameters:
      searchRoot - Element from where to begin the search or null if whole system is to be searched
      predicate - The predicate to match the element.
      Returns:
      A list of elements matching the predicate (can be empty).
    • getWorkspaceRoot

      INamedElementAccess getWorkspaceRoot()
    • visitParserModel

      void visitParserModel(ModelVisitor visitor)
      Visit only the parser model
      Parameters:
      visitor - the visitor
    • visitLogicalModuleNamespaces

      void visitLogicalModuleNamespaces(ModelVisitor visitor)
      Visit module level logical namespaces
      Parameters:
      visitor - the visitor
    • visitLogicalSystemNamespaces

      void visitLogicalSystemNamespaces(ModelVisitor visitor)
      Visit system level logical namespaces
      Parameters:
      visitor - the visitor