Class ExportMethodProvider


  • public final class ExportMethodProvider
    extends Object
    Special provider for caching bsl exporting methods. Important that provider does not return clear exporting methods, it returns special Method without resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not
    • Constructor Detail

      • ExportMethodProvider

        @Inject
        public ExportMethodProvider​(Path path,
                                    Path oldPath,
                                    IResourceLookup resourceLookup)
        Constructs a new instance.
        Parameters:
        path - The provider directory path. May not be null.
        oldPath - The old provider directory path. May not be null.
        resourceLookup - The resource lookup. May not be null.
    • Method Detail

      • activate

        public void activate()
        Activates the provider.
      • open

        public void open​(org.eclipse.core.resources.IProject project,
                         boolean clean)
        Opens the store for the specified project.
        Parameters:
        project - The project. May not be null.
        clean - The flag indicating whether the store must be cleaned.
      • close

        public void close​(org.eclipse.core.resources.IProject project,
                          boolean clean)
        Closes the store for the specified project.
        Parameters:
        project - The project. May not be null.
        shutdown - The flag indicating whether the application is being shut down.
        clean - The flag indicating whether the store must be cleaned.
      • updateExportMethods

        public void updateExportMethods​(BslContextDef contextDef)
        Updates information about exported methods
        Parameters:
        contextDef - BslContextDef with actual exported methods for one module, cannot be null
      • hasExportMethod

        public boolean hasExportMethod​(String contextDefUri)
        Checks that there is information about exported methods for concrete module
        Parameters:
        contextDefUri - string presentation of context def URI of module, cannot be null
        Returns:
        true if information is available, false otherwise
      • hasExportProperty

        public boolean hasExportProperty​(String contextDefUri)
        Checks that there is information about exported properties for concrete module
        Parameters:
        contextDefUri - string presentation of context def URI of module, cannot be null
        Returns:
        true if information is available, false otherwise
      • getMockMethods

        public Collection<Method> getMockMethods​(String contextDefUri,
                                                 String methodName,
                                                 org.eclipse.emf.ecore.EObject context)
        Gets mock of real exported methods by name for concrete module
        Parameters:
        contextDefUri - string presentation of context def URI of module, cannot be null
        methodName - name of getting mock exported methods, cannot be null
        context - TODO
        Returns:
        collection of mock exported methods. Mock methods is special Method without resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not
      • getMockProperties

        public Collection<Property> getMockProperties​(String contextDefUri,
                                                      String propertyName,
                                                      org.eclipse.emf.ecore.EObject context)
        Gets mock of real exported properties by name for concrete module
        Parameters:
        contextDefUri - string presentation of context def URI of module, cannot be null
        propertyName - name of getting mock exported properties, cannot be null
        Returns:
        collection of mock exported properties. Mock property is special Property without resource and container, which contains right name of the export property, right properties: source uri to the real property in module