org.eclipse.viatra.query.patternlanguage.emf.scoping

## Class CompoundMetamodelProviderService

- java.lang.Object
- - org.eclipse.viatra.query.patternlanguage.emf.scoping.CompoundMetamodelProviderService

- All Implemented Interfaces:
    IMetamodelProvider

      public class CompoundMetamodelProviderService
      extends java.lang.Object
      implements IMetamodelProvider

  A new, delegating metamodel provider that can handle multiple different `IMetamodelProviderInstance` implementations, and sorts them based on priority.
  Since:
    1.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompoundMetamodelProviderService(java.util.Set<IMetamodelProviderInstance> providers)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.eclipse.xtext.scoping.IScope` | `getAllMetamodelObjects(org.eclipse.xtext.scoping.IScope delegateScope, org.eclipse.emf.ecore.EObject context)` Returns a set of all available EPackages wrapped into `IEObjectDescription` for the use of scoping.
    `java.lang.String` | `getModelPluginId(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.ResourceSet set)` Returns the identifier of the plugin that contains the generated model code.
    `java.lang.String` | `getQualifiedClassName(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EObject context)`
    `boolean` | `isGeneratedCodeAvailable(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.ResourceSet set)` Returns true if the generated code is available for the given EPackage, the code uses the given resource set as context.
    `org.eclipse.emf.ecore.EPackage` | `loadEPackage(java.lang.String uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)` Loads an EMF package from the nsURI or resource URI of the model, and uses the resource set given as the second parameter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CompoundMetamodelProviderService

          @Inject
          public CompoundMetamodelProviderService(java.util.Set<IMetamodelProviderInstance> providers)

  - ### Method Detail

    - #### getAllMetamodelObjects

          public org.eclipse.xtext.scoping.IScope getAllMetamodelObjects(org.eclipse.xtext.scoping.IScope delegateScope,
                                                                         org.eclipse.emf.ecore.EObject context)

      Description copied from interface: `IMetamodelProvider`
      Returns a set of all available EPackages wrapped into `IEObjectDescription` for the use of scoping. It uses the `IEObjectDescription`s from the delegate scope provider too, this way the `EPackage`s from the XText index will be available too.
      Specified by:
        `getAllMetamodelObjects` in interface `IMetamodelProvider`
      Parameters:
        `delegateScope` - the delegate scope
        `context` - the context object for the scoping

    - #### loadEPackage

          public org.eclipse.emf.ecore.EPackage loadEPackage(java.lang.String uri,
                                                             org.eclipse.emf.ecore.resource.ResourceSet resourceSet)

      Description copied from interface: `IMetamodelProvider`
      Loads an EMF package from the nsURI or resource URI of the model, and uses the resource set given as the second parameter.
      Specified by:
        `loadEPackage` in interface `IMetamodelProvider`
      Returns:
        the loaded EMF EPackage

    - #### isGeneratedCodeAvailable

          public boolean isGeneratedCodeAvailable(org.eclipse.emf.ecore.EPackage ePackage,
                                                  org.eclipse.emf.ecore.resource.ResourceSet set)

      Description copied from interface: `IMetamodelProvider`
      Returns true if the generated code is available for the given EPackage, the code uses the given resource set as context.
      Specified by:
        `isGeneratedCodeAvailable` in interface `IMetamodelProvider`
      Parameters:
        `ePackage` - for which the availability of generated code is checked
        `set` - used for context in the checking
      Returns:
        true, if the generated code for the EPackage is available

    - #### getModelPluginId

          public java.lang.String getModelPluginId(org.eclipse.emf.ecore.EPackage ePackage,
                                                   org.eclipse.emf.ecore.resource.ResourceSet set)

      Description copied from interface: `IMetamodelProvider`
      Returns the identifier of the plugin that contains the generated model code.
      Specified by:
        `getModelPluginId` in interface `IMetamodelProvider`
      Parameters:
        `ePackage` - for which the model plugin ID is requested
        `set` - used for context in the searching
      Returns:
        the model plugin ID or null if it cannot be found
      Since:
        1.5

    - #### getQualifiedClassName

          public java.lang.String getQualifiedClassName(org.eclipse.emf.ecore.EClassifier classifier,
                                                        org.eclipse.emf.ecore.EObject context)

      Specified by:
        `getQualifiedClassName` in interface `IMetamodelProvider`