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​(IResourceLookup resourceLookup,
                                    IBmModelManager bmModelManager,
                                    INamingService namingService)
        Constructs a new instance.
        Parameters:
        resourceLookup - The resource lookup. May not be null
        bmModelManager - The IBmModelManager service reference. May not be null
        namingService - The INamingService service reference. May not be null
    • Method Detail

      • open

        public void open​(org.eclipse.core.resources.IProject project)
        Opens the store for the specified project.
        Parameters:
        project - The project. May not be null.
      • close

        public void close​(org.eclipse.core.resources.IProject project)
        Closes the store for the specified project.
        Parameters:
        project - The project. May not be null.
      • revertExportMethodIndexChanges

        public void revertExportMethodIndexChanges​(String contextDefFqn,
                                                   IBmModel bmModel)
        Updates information about exported methods
        Parameters:
        contextDefFqn - FQN of a target context def. May not be null
        bmModel - A target BM model which contains the target context def. May not be null
      • 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​(ContextDef moduleContextDef)
        Checks that there is information about exported methods for concrete module
        Parameters:
        moduleContextDef - Target module context def. May not be null
        Returns:
        true if information is available, false otherwise
      • hasExportProperty

        public boolean hasExportProperty​(ContextDef contextDef)
        Checks that there is information about exported properties for concrete module
        Parameters:
        moduleContextDef - Target module context def. May not be null
        Returns:
        true if information is available, false otherwise
      • getMockMethods

        public Collection<Method> getMockMethods​(ContextDef moduleContextDef,
                                                 String methodName,
                                                 org.eclipse.emf.ecore.EObject context)
        Gets mock of real exported methods by name for concrete module
        Parameters:
        moduleContextDef - Target module context def. May not be null
        methodName - name of getting mock exported methods, cannot be null
        context - The context object ot set into the mock. May not be null
        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​(ContextDef moduleContextDef,
                                                      String propertyName,
                                                      org.eclipse.emf.ecore.EObject context)
        Gets mock of real exported properties by name for concrete module
        Parameters:
        moduleContextDef - Target module context def. May not 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