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

## Class BaseGeneratedPrivateEMFQuerySpecification

- 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.BaseGeneratedPrivateEMFQuerySpecification

- All Implemented Interfaces:
    IQuerySpecification<GenericPatternMatcher>, PQueryHeader

      public abstract class BaseGeneratedPrivateEMFQuerySpecification
      extends GenericQuerySpecification<GenericPatternMatcher>

  Provides common functionality of pattern-specific generated query specifications for private patterns over the EMF scope.
  Since:
    1.6

- - ### Field Summary

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

      `wrappedPQuery`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseGeneratedPrivateEMFQuerySpecification(PQuery wrappedPQuery)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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`

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

      `ensureInitializedInternal, ensureInitializedInternalSneaky, 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`

- - ### Constructor Detail

    - #### BaseGeneratedPrivateEMFQuerySpecification

          public BaseGeneratedPrivateEMFQuerySpecification(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)
                                               throws ViatraQueryException

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

    - #### instantiate

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

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