Class BaseQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>
java.lang.Object
tools.refinery.interpreter.api.impl.BaseQuerySpecification<Matcher>
- All Implemented Interfaces:
IQuerySpecification<Matcher>
,PQueryHeader
- Direct Known Subclasses:
GenericQuerySpecification
public abstract class BaseQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>
extends Object
implements IQuerySpecification<Matcher>
Base implementation of IQuerySpecification.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseQuerySpecification
(PQuery wrappedPQuery) Instantiates query specification for the given internal query representation. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Returns the list of annotations specified for this querygetAnnotationsByName
(String annotationName) Returns the list of annotations with a specified namegetFirstAnnotationByName
(String annotationName) Returns the first annotation with a specified nameIdentifies the pattern for which matchers can be instantiated.Returns the definition of the query in a format intended for consumption by the query evaluator.getMatcher
(InterpreterEngine engine) Initializes the pattern matcher within an existingInterpreterEngine
.Return the list of parameter namesReturns a list of parameter descriptionsgetPositionOfParameter
(String parameterName) Returns the index of a named parameterReturns the visibility information about the query.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 abstract Matcher
instantiate
(InterpreterEngine engine) protected static InterpreterException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tools.refinery.interpreter.api.IQuerySpecification
getPProblems, getPreferredScopeClass, getStatus, newEmptyMatch, newMatch
Methods inherited from interface tools.refinery.interpreter.matchers.psystem.queries.PQueryHeader
getParameter, getSimpleName
-
Field Details
-
wrappedPQuery
-
-
Constructor Details
-
BaseQuerySpecification
Instantiates query specification for the given internal query representation.
-
-
Method Details
-
processInitializerError
- Since:
- 1.6
-
instantiate
-
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.- Specified by:
instantiate
in interfaceIQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>
- Since:
- 1.4
-
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 interfaceIQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>
- Returns:
- the internal representation of the query.
-
getMatcher
Description copied from interface:IQuerySpecification
Initializes the pattern matcher within an existingInterpreterEngine
. If the pattern matcher is already constructed in the engine, only a lightweight reference is created.The match set will be incrementally refreshed upon updates.
- Specified by:
getMatcher
in interfaceIQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>
- Parameters:
engine
- the existing Refinery Interpreter engine in which this matcher will be created.
-
ensureInitializedInternal
protected void ensureInitializedInternal() -
getAllAnnotations
Description copied from interface:PQueryHeader
Returns the list of annotations specified for this query- Specified by:
getAllAnnotations
in interfacePQueryHeader
- Returns:
- a non-null, but possibly empty list of annotations
-
getAnnotationsByName
Description copied from interface:PQueryHeader
Returns the list of annotations with a specified name- Specified by:
getAnnotationsByName
in interfacePQueryHeader
- Parameters:
annotationName
-- Returns:
- a non-null, but possibly empty list of annotations
-
getFirstAnnotationByName
Description copied from interface:PQueryHeader
Returns the first annotation with a specified name- Specified by:
getFirstAnnotationByName
in interfacePQueryHeader
-
getFullyQualifiedName
Description copied from interface:PQueryHeader
Identifies the pattern for which matchers can be instantiated.- Specified by:
getFullyQualifiedName
in interfacePQueryHeader
-
getParameterNames
Description copied from interface:PQueryHeader
Return the list of parameter names- Specified by:
getParameterNames
in interfacePQueryHeader
- Returns:
- a non-null, but possibly empty list of parameter names
-
getParameters
Description copied from interface:PQueryHeader
Returns a list of parameter descriptions- Specified by:
getParameters
in interfacePQueryHeader
- Returns:
- a non-null, but possibly empty list of parameter descriptions
-
getPositionOfParameter
Description copied from interface:PQueryHeader
Returns the index of a named parameter- Specified by:
getPositionOfParameter
in interfacePQueryHeader
- Parameters:
parameterName
-- Returns:
- the index, or null of no such parameter is available
-
getVisibility
Description copied from interface:PQueryHeader
Returns the visibility information about the query.- Specified by:
getVisibility
in interfacePQueryHeader
- Since:
- 2.0
-