Package tools.refinery.interpreter.api
Class GenericQuerySpecification<Matcher extends GenericPatternMatcher>
java.lang.Object
tools.refinery.interpreter.api.impl.BaseQuerySpecification<Matcher>
tools.refinery.interpreter.api.GenericQuerySpecification<Matcher>
- All Implemented Interfaces:
IQuerySpecification<Matcher>
,PQueryHeader
public abstract class GenericQuerySpecification<Matcher extends GenericPatternMatcher>
extends BaseQuerySpecification<Matcher>
This is a generic query specification for Refinery Interpreter pattern matchers, for "interpretative" query
execution. Should be subclassed by query specification implementations specific to query languages.
When available, consider using the pattern-specific generated matcher API instead.
The created matcher will be of type GenericPatternMatcher
. Matches of the pattern will be represented as
GenericPatternMatch
.
Note for overriding (if you have your own query language or ):
Derived classes should use defaultInstantiate(InterpreterEngine)
for implementing
BaseQuerySpecification.instantiate(InterpreterEngine)
if they use GenericPatternMatcher
proper.
- Since:
- 0.9
- See Also:
-
Field Summary
Fields inherited from class tools.refinery.interpreter.api.impl.BaseQuerySpecification
wrappedPQuery
-
Constructor Summary
ConstructorsConstructorDescriptionGenericQuerySpecification
(PQuery wrappedPQuery) Instantiates query specification for the given internal query representation. -
Method Summary
Modifier and TypeMethodDescriptionprotected GenericPatternMatcher
defaultInstantiate
(InterpreterEngine engine) Derived classes should use this implementation ofBaseQuerySpecification.instantiate(InterpreterEngine)
if they useGenericPatternMatcher
proper.Returns the visibility information about the query.Returns an empty, mutable Match compatible with matchers of this query.Returns a new (partial) Match object compatible with matchers of this query.Methods inherited from class tools.refinery.interpreter.api.impl.BaseQuerySpecification
ensureInitializedInternal, getAllAnnotations, getAnnotationsByName, getFirstAnnotationByName, getFullyQualifiedName, getInternalQueryRepresentation, getMatcher, getParameterNames, getParameters, getPositionOfParameter, instantiate, instantiate, processInitializerError
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
Methods inherited from interface tools.refinery.interpreter.matchers.psystem.queries.PQueryHeader
getParameter, getSimpleName
-
Constructor Details
-
GenericQuerySpecification
Instantiates query specification for the given internal query representation.
-
-
Method Details
-
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.- Returns:
- the empty match
-
newMatch
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.- Parameters:
parameters
- the fixed value of pattern parameters, or null if not bound.- Returns:
- the (partial) match object.
-
defaultInstantiate
Derived classes should use this implementation ofBaseQuerySpecification.instantiate(InterpreterEngine)
if they useGenericPatternMatcher
proper.- Throws:
InterpreterRuntimeException
-
getVisibility
Description copied from interface:PQueryHeader
Returns the visibility information about the query.- Specified by:
getVisibility
in interfacePQueryHeader
- Overrides:
getVisibility
in classBaseQuerySpecification<Matcher extends GenericPatternMatcher>
- Since:
- 2.0
-