Package org.eclipse.viatra.query.runtime.api.impl

## Class BaseGeneratedEMFQuerySpecificationWithGenericMatcher

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

- All Implemented Interfaces:
    `IQuerySpecification<GenericPatternMatcher>`, `PQueryHeader`

      public abstract class BaseGeneratedEMFQuerySpecificationWithGenericMatcher
      extends GenericQuerySpecification<GenericPatternMatcher>

  Provides common functionality of pattern-specific generated query specifications for without generated pattern-specific match and matcher classes, including private patterns.
  Since:
    1.7

- - ### Field Summary

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

      `wrappedPQuery`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BaseGeneratedEMFQuerySpecificationWithGenericMatcher​(PQuery wrappedPQuery)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Class<? extends QueryScope>` | `getPreferredScopeClass()` | The query is formulated over this kind of modeling platform.
    `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.
    `protected GenericPatternMatcher` | `instantiate​(ViatraQueryEngine engine)` |
    `GenericPatternMatch` | `newEmptyMatch()` | Returns an empty, mutable Match compatible with matchers of this query.
    `GenericPatternMatch` | `newMatch​(java.lang.Object... parameters)` | Returns a new (partial) Match object compatible with matchers of this query.

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

      `defaultInstantiate, getVisibility`

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

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

    - ### 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.runtime.api.IQuerySpecification

      `getPProblems, getStatus`

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader

      `getParameter, getSimpleName`

- - ### Constructor Detail

    - #### BaseGeneratedEMFQuerySpecificationWithGenericMatcher

          public BaseGeneratedEMFQuerySpecificationWithGenericMatcher​(PQuery wrappedPQuery)

  - ### Method Detail

    - #### 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

          protected GenericPatternMatcher instantiate​(ViatraQueryEngine engine)

      Specified by:
        `instantiate` in class `BaseQuerySpecification<GenericPatternMatcher>`

    - #### instantiate

          public GenericPatternMatcher instantiate()

      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<GenericPatternMatcher>`
      Overrides:
        `instantiate` in class `BaseQuerySpecification<GenericPatternMatcher>`

    - #### newEmptyMatch

          public GenericPatternMatch newEmptyMatch()

      Description copied from interface: `IQuerySpecification`
      Returns an empty, mutable Match compatible with matchers of this query. Fields of the mutable match can be filled to create a partial match, usable as matcher input. This can be used to call the matcher with a partial match even if the specific class of the matcher or the match is unknown.
      Specified by:
        `newEmptyMatch` in interface `IQuerySpecification<GenericPatternMatcher>`
      Overrides:
        `newEmptyMatch` in class `GenericQuerySpecification<GenericPatternMatcher>`
      Returns:
        the empty match

    - #### newMatch

          public GenericPatternMatch newMatch​(java.lang.Object... parameters)

      Description copied from interface: `IQuerySpecification`
      Returns a new (partial) Match object compatible with matchers of this query. This can be used e.g. to call the matcher with a partial match.

      The returned match will be immutable. Use `IQuerySpecification.newEmptyMatch()` to obtain a mutable match object.

      Specified by:
        `newMatch` in interface `IQuerySpecification<GenericPatternMatcher>`
      Overrides:
        `newMatch` in class `GenericQuerySpecification<GenericPatternMatcher>`
      Parameters:
        `parameters` - the fixed value of pattern parameters, or null if not bound.
      Returns:
        the (partial) match object.