org.eclipse.viatra.query.patternlanguage.emf.specification

## Class GenericQuerySpecification

- java.lang.Object
- - org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification<Matcher>
  - - org.eclipse.viatra.query.runtime.api.GenericQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>
    - - org.eclipse.viatra.query.patternlanguage.emf.specification.GenericQuerySpecification

- All Implemented Interfaces:
    IQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>, PQueryHeader

      public class GenericQuerySpecification
      extends GenericQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>

  This is a generic query specification for VIATRA Query pattern matchers, for "interpretative" query execution. Instantiate the specification with any registered pattern (or through a `SpecificationBuilder` instance), and then use the specification to obtain an actual pattern matcher operating on a given model.

  When available, consider using the pattern-specific generated matcher API instead.

  The created matcher will be of type org.eclipse.viatra.query.runtime.api.GenericPatternMatcher. Matches of the pattern will be represented as GenericPatternMatch.

  See Also:
    `GenericPatternMatcher`, `GenericPatternMatch`, `GenericMatchProcessor`
  No Instantiate:
    This class is not intended to be instantiated by clients

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected GenericEMFPatternPQuery` | `genericEMFPatternPQuery`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification

      `wrappedPQuery`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericQuerySpecification(GenericEMFPatternPQuery genericEMFPatternPQuery)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GenericEMFPatternPQuery` | `getInternalQueryRepresentation()` Returns the definition of the query in a format intended for consumption by the query evaluator.
    `java.lang.Class<? extends QueryScope>` | `getPreferredScopeClass()` The query is formulated over this kind of modeling platform.
    `org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher` | `instantiate()` For backward compatibility of code generated with previous versions of viatra query, this method has a default implementation returning null, indicating that a matcher can only be created using the old method, which ignores the hints provided by the user.
    `org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher` | `instantiate(ViatraQueryEngine engine)`

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.api.GenericQuerySpecification

      `defaultInstantiate, newEmptyMatch, newMatch`

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification

      `ensureInitializedInternal, ensureInitializedInternalSneaky, getAllAnnotations, getAnnotationsByName, getFirstAnnotationByName, getFullyQualifiedName, getMatcher, getParameterNames, getParameters, getPositionOfParameter, processInitializerError`

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

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

- - ### Field Detail

    - #### genericEMFPatternPQuery

          protected GenericEMFPatternPQuery genericEMFPatternPQuery

  - ### Constructor Detail

    - #### GenericQuerySpecification

          public GenericQuerySpecification(GenericEMFPatternPQuery genericEMFPatternPQuery)

  - ### Method Detail

    - #### getInternalQueryRepresentation

          public GenericEMFPatternPQuery getInternalQueryRepresentation()

      Description copied from interface: `IQuerySpecification`
      Returns the definition of the query in a format intended for consumption by the query evaluator.
      Specified by:
        `getInternalQueryRepresentation` in interface `IQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>`
      Overrides:
        `getInternalQueryRepresentation` in class `BaseQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>`
      Returns:
        the internal representation of the query.

    - #### instantiate

          public org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher instantiate(ViatraQueryEngine engine)
                                                                                                       throws ViatraQueryException

      Specified by:
        `instantiate` in class `BaseQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>`
      Throws:
        `ViatraQueryException`

    - #### getPreferredScopeClass

          public java.lang.Class<? extends QueryScope> getPreferredScopeClass()

      Description copied from interface: `IQuerySpecification`
      The query is formulated over this kind of modeling platform. E.g. for queries over EMF models, the `EMFScope` class is returned.

    - #### instantiate

          public org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher instantiate()
                                                                                                       throws ViatraQueryException

      Description copied from class: `BaseQuerySpecification`
      For backward compatibility of code generated with previous versions of viatra query, this method has a default implementation returning null, indicating that a matcher can only be created using the old method, which ignores the hints provided by the user.
      Specified by:
        `instantiate` in interface `IQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>`
      Overrides:
        `instantiate` in class `BaseQuerySpecification<org.eclipse.viatra.query.patternlanguage.emf.specification.GenericPatternMatcher>`
      Throws:
        `ViatraQueryException`
      Since:
        1.4