org.eclipse.viatra.query.runtime.extensibility

## Class QuerySpecificationRegistry

- java.lang.Object
- - org.eclipse.viatra.query.runtime.extensibility.QuerySpecificationRegistry

- Deprecated.
  Use `QuerySpecificationRegistry.getInstance()` and read notes on deprecated methods for usage.

      public final class QuerySpecificationRegistry
      extends java.lang.Object

  Registry for query specifications that can be accessed using fully qualified names. In addition, it can create query groups based on the package hierarchy, even if the queries are defined in different projects or query definition files. When running as an OSGi plug-in, the generated query specifications registered through extensions are automatically loaded into the registry by the `ExtensionBasedQuerySpecificationLoader` class.

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>>` | `getContributedQuerySpecifications()` Deprecated. Use getDefaultView().getQueryGroup().getSpecifications() instead
    `static java.util.Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>>` | `getPatternGroup(java.lang.String packageFQN)` Deprecated. Use new `PackageBasedQueryGroup`(String packageFQN).getSpecifications() instead
    `static java.util.Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>>` | `getPatternSubTree(java.lang.String packageFQN)` Deprecated. Use `PackageBasedQueryGroup`(String packageFQN, true).getSpecifications() instead
    `static IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>` | `getQuerySpecification(java.lang.String patternFQN)` Deprecated. Use getDefaultView().getEntry(String).get() instead
    `static void` | `registerQuerySpecification(IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> specification)` Deprecated. Register your own `IRegistrySourceConnector` through `#addSource` instead to add and remove specifications.
    `static void` | `unregisterQuerySpecification(java.lang.String patternFQN)` Deprecated. Register your own `IRegistrySourceConnector` through `#addSource` instead to add and remove specifications.

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

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

- - ### Method Detail

    - #### registerQuerySpecification

          public static void registerQuerySpecification(IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> specification)

      Deprecated. Register your own `IRegistrySourceConnector` through `#addSource` instead to add and remove specifications.
      Puts the specification in the registry, unless it already contains a specification for the given pattern FQN
      Parameters:
        `specification` -

    - #### unregisterQuerySpecification

          public static void unregisterQuerySpecification(java.lang.String patternFQN)

      Deprecated. Register your own `IRegistrySourceConnector` through `#addSource` instead to add and remove specifications.
      Removes the query specification from the registry which belongs to the given fully qualified pattern name. Only dynamically added specifications can be removed! Specifications contributed by extensions cannot be removed. Calling with an FQN that is not dynamically added has no effect.
      Parameters:
        `patternFQN` - the fully qualified name of the pattern

    - #### getContributedQuerySpecifications

          public static java.util.Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> getContributedQuerySpecifications()

      Deprecated. Use getDefaultView().getQueryGroup().getSpecifications() instead
      Returns:
        the set of contributed query specifications

    - #### getQuerySpecification

          public static IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification(java.lang.String patternFQN)

      Deprecated. Use getDefaultView().getEntry(String).get() instead
      Parameters:
        `patternFQN` - the fully qualified name of a registered generated pattern
      Returns:
        the generated query specification of the pattern with the given fully qualified name, if it is registered, or null if there is no such generated pattern

    - #### getPatternGroup

          public static java.util.Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> getPatternGroup(java.lang.String packageFQN)

      Deprecated. Use new `PackageBasedQueryGroup`(String packageFQN).getSpecifications() instead
      Returns the set of query specifications in a given package. Only query specifications with the exact package fully qualified name are returned.
      Parameters:
        `packageFQN` - the fully qualified name of the package
      Returns:
        the set of query specifications inside the given package, empty set otherwise.

    - #### getPatternSubTree

          public static java.util.Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> getPatternSubTree(java.lang.String packageFQN)

      Deprecated. Use `PackageBasedQueryGroup`(String packageFQN, true).getSpecifications() instead
      Returns the set of query specifications in a given package. All query specifications with package names starting with the given package are returned.
      Parameters:
        `packageFQN` - the fully qualified name of the package
      Returns:
        the set of query specifications in the given package subtree, empty set otherwise.