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 voidReturns 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.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 Matcherinstantiate(InterpreterEngine engine) protected static InterpreterExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.api.IQuerySpecification
getPProblems, getPreferredScopeClass, getStatus, newEmptyMatch, newMatchMethods 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
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:
instantiatein interfaceIQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>- Since:
- 1.4
-
getInternalQueryRepresentation
Description copied from interface:IQuerySpecificationReturns the definition of the query in a format intended for consumption by the query evaluator.- Specified by:
getInternalQueryRepresentationin interfaceIQuerySpecification<Matcher extends InterpreterMatcher<? extends IPatternMatch>>- Returns:
- the internal representation of the query.
-
getMatcher
Description copied from interface:IQuerySpecificationInitializes 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:
getMatcherin 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:PQueryHeaderReturns the list of annotations specified for this query- Specified by:
getAllAnnotationsin interfacePQueryHeader- Returns:
- a non-null, but possibly empty list of annotations
-
getAnnotationsByName
Description copied from interface:PQueryHeaderReturns the list of annotations with a specified name- Specified by:
getAnnotationsByNamein interfacePQueryHeader- Parameters:
annotationName-- Returns:
- a non-null, but possibly empty list of annotations
-
getFirstAnnotationByName
Description copied from interface:PQueryHeaderReturns the first annotation with a specified name- Specified by:
getFirstAnnotationByNamein interfacePQueryHeader
-
getFullyQualifiedName
Description copied from interface:PQueryHeaderIdentifies the pattern for which matchers can be instantiated.- Specified by:
getFullyQualifiedNamein interfacePQueryHeader
-
getParameterNames
Description copied from interface:PQueryHeaderReturn the list of parameter names- Specified by:
getParameterNamesin interfacePQueryHeader- Returns:
- a non-null, but possibly empty list of parameter names
-
getParameters
Description copied from interface:PQueryHeaderReturns a list of parameter descriptions- Specified by:
getParametersin interfacePQueryHeader- Returns:
- a non-null, but possibly empty list of parameter descriptions
-
getPositionOfParameter
Description copied from interface:PQueryHeaderReturns the index of a named parameter- Specified by:
getPositionOfParameterin interfacePQueryHeader- Parameters:
parameterName-- Returns:
- the index, or null of no such parameter is available
-
getVisibility
Description copied from interface:PQueryHeaderReturns the visibility information about the query.- Specified by:
getVisibilityin interfacePQueryHeader- Since:
- 2.0
-