org.eclipse.viatra.query.tooling.core.targetplatform

## Class TargetPlatformMetamodelProviderService

- java.lang.Object
- - org.eclipse.viatra.query.patternlanguage.emf.scoping.BaseMetamodelProviderService
  - - org.eclipse.viatra.query.tooling.core.targetplatform.TargetPlatformMetamodelProviderService

- All Implemented Interfaces:
    IMetamodelProvider, IMetamodelProviderInstance

      public class TargetPlatformMetamodelProviderService
      extends BaseMetamodelProviderService
      implements IMetamodelProviderInstance

  Subclass implementation of MetamdelProviderService, which queries registered metamodel packages from the TargetPlatform instead of the PackageRegistry.

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.patternlanguage.emf.scoping.BaseMetamodelProviderService

      `logger, qualifiedNameConverter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TargetPlatformMetamodelProviderService()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `doGetQualifiedClassName(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EObject context)`
    `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` | `getIdentifier()` Get a textual identifier for the metamodel provider instance
    `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.
    `int` | `getPriority()` A default priority for the provider instance; a lower number means a higher priority.
    `protected java.util.Collection<java.lang.String>` | `getProvidedMetamodels()`
    `protected org.eclipse.emf.codegen.ecore.genmodel.GenPackage` | `internalFindGenPackage(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.lang.String packageUri)`
    `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 packageUri, 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 org.eclipse.viatra.query.patternlanguage.emf.scoping.BaseMetamodelProviderService

      `getGenmodelRegistry, getModelPluginId, getQualifiedClassName`

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

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

    - ### Methods inherited from interface org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider

      `getQualifiedClassName`

- - ### Constructor Detail

    - #### TargetPlatformMetamodelProviderService

          public TargetPlatformMetamodelProviderService()

  - ### Method Detail

    - #### getIdentifier

          public java.lang.String getIdentifier()

      Description copied from interface: `IMetamodelProviderInstance`
      Get a textual identifier for the metamodel provider instance
      Specified by:
        `getIdentifier` in interface `IMetamodelProviderInstance`
      Returns:
        a non-null textual identifier; should be unique over all possible implementations

    - #### getPriority

          public int getPriority()

      Description copied from interface: `IMetamodelProviderInstance`
      A default priority for the provider instance; a lower number means a higher priority. The priority may be overriden through `CompoundMetamodelProviderService`.
      Specified by:
        `getPriority` in interface `IMetamodelProviderInstance`
      Returns:
        a non-negative priority number

    - #### 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`
      Overrides:
        `isGeneratedCodeAvailable` in class `BaseMetamodelProviderService`
      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`
      Overrides:
        `getModelPluginId` in class `BaseMetamodelProviderService`
      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

    - #### getProvidedMetamodels

          protected java.util.Collection<java.lang.String> getProvidedMetamodels()

      Specified by:
        `getProvidedMetamodels` in class `BaseMetamodelProviderService`

    - #### 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`
      Overrides:
        `getAllMetamodelObjects` in class `BaseMetamodelProviderService`
      Parameters:
        `delegateScope` - the delegate scope
        `context` - the context object for the scoping

    - #### internalFindGenPackage

          protected org.eclipse.emf.codegen.ecore.genmodel.GenPackage internalFindGenPackage(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                                                                                             java.lang.String packageUri)

    - #### loadEPackage

          public org.eclipse.emf.ecore.EPackage loadEPackage(java.lang.String packageUri,
                                                             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

    - #### doGetQualifiedClassName

          protected java.lang.String doGetQualifiedClassName(org.eclipse.emf.ecore.EClassifier classifier,
                                                             org.eclipse.emf.ecore.EObject context)

      Specified by:
        `doGetQualifiedClassName` in class `BaseMetamodelProviderService`