Interface SearchObjectResolver

  • All Known Implementing Classes:
    SearchObjectResolver.BasicResolver, SearchObjectResolver.CompatibilityResolver

    public interface SearchObjectResolver
    Abstracts revival of searched objects from their IHolder persistence into something MPS could search for. Unlike SearchScope, this interface helps to answer 'What is being looked up', not 'Where it's to be looked up'.

    Distinction between SearchScope and SearchObjectResolver is apparent if you think about scenario, when one looks for instances of a concept declaration in a set of modules. Concept declaration originates in a model/module that is not necessarily among the modules/models we search through. In fact, quite the opposite, it's unlikely to be among them.

    Use this interface to translate search objects obtained through IHolder.getObject().

    Find Usages client is responsible to ensure proper model access so that these methods, invoked during IFinder.find(SearchQuery, ProgressMonitor), do not fail.

    Since:
    2017.1
    • Method Detail

      • resolve

        @Nullable
        SModel resolve​(@NotNull
                       SModelReference reference)
        Finder may use this method to go from model reference as a search value to SModel object. Find Usages client may use this method to limit what's visible/accessible to a Finder.
        Parameters:
        reference - model to resolve
        Returns:
        model instance, or null if model with specified reference is not available
      • resolve

        @Nullable
        SModule resolve​(@NotNull
                        SModuleReference reference)
        Finder may use this method to go from module reference as a seatch value to SModule object. Find Usages client may use this method to limit what's visible/accessible to a Finder.
        Parameters:
        reference - module to resolve
        Returns:
        module instance, or null if there's no such module
      • resolve

        @Nullable
        default SNode resolve​(@NotNull
                              SNodeReference reference)
        Finder may use this method to go from model reference as a search value to SNode object. Find Usages client may use this method to limit what's visible/accessible to a Finder.
        Parameters:
        reference - node to resolve
        Returns:
        node instance of null if the node is unknown