public abstract class BaseQuerySpecification<Matcher extends ViatraQueryMatcher<? extends IPatternMatch>> extends java.lang.Object implements IQuerySpecification<Matcher>
Modifier and Type | Field and Description |
---|---|
protected PQuery |
wrappedPQuery |
Constructor and Description |
---|
BaseQuerySpecification(PQuery wrappedPQuery)
Instantiates query specification for the given internal query representation.
|
Modifier and Type | Method and Description |
---|---|
protected void |
ensureInitializedInternal() |
protected void |
ensureInitializedInternalSneaky() |
java.util.List<PAnnotation> |
getAllAnnotations()
Returns the list of annotations specified for this query
|
java.util.List<PAnnotation> |
getAnnotationsByName(java.lang.String annotationName)
Returns the list of annotations with a specified name
|
PAnnotation |
getFirstAnnotationByName(java.lang.String annotationName)
Returns the first annotation with a specified name
|
java.lang.String |
getFullyQualifiedName()
Identifies the pattern for which matchers can be instantiated.
|
PQuery |
getInternalQueryRepresentation()
Returns the definition of the query in a format intended for consumption by the query evaluator.
|
Matcher |
getMatcher(ViatraQueryEngine engine)
Initializes the pattern matcher within an existing
ViatraQueryEngine . |
java.util.List<java.lang.String> |
getParameterNames()
Return the list of parameter names
|
java.util.List<PParameter> |
getParameters()
Returns a list of parameter descriptions
|
java.lang.Integer |
getPositionOfParameter(java.lang.String parameterName)
Returns the index of a named parameter
|
Matcher |
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 abstract Matcher |
instantiate(ViatraQueryEngine engine) |
protected static ViatraQueryException |
processInitializerError(java.lang.ExceptionInInitializerError err) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreferredScopeClass, newEmptyMatch, newMatch
protected final PQuery wrappedPQuery
public BaseQuerySpecification(PQuery wrappedPQuery)
protected static ViatraQueryException processInitializerError(java.lang.ExceptionInInitializerError err)
protected abstract Matcher instantiate(ViatraQueryEngine engine) throws ViatraQueryException
ViatraQueryException
public Matcher instantiate() throws ViatraQueryException
instantiate
in interface IQuerySpecification<Matcher extends ViatraQueryMatcher<? extends IPatternMatch>>
ViatraQueryException
public PQuery getInternalQueryRepresentation()
IQuerySpecification
getInternalQueryRepresentation
in interface IQuerySpecification<Matcher extends ViatraQueryMatcher<? extends IPatternMatch>>
public Matcher getMatcher(ViatraQueryEngine engine) throws ViatraQueryException
IQuerySpecification
ViatraQueryEngine
. 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.
getMatcher
in interface IQuerySpecification<Matcher extends ViatraQueryMatcher<? extends IPatternMatch>>
engine
- the existing VIATRA Query engine in which this matcher will be created.ViatraQueryException
- if an error occurs during pattern matcher creationprotected void ensureInitializedInternal() throws ViatraQueryException
ViatraQueryException
protected void ensureInitializedInternalSneaky()
public java.util.List<PAnnotation> getAllAnnotations()
PQueryHeader
getAllAnnotations
in interface PQueryHeader
public java.util.List<PAnnotation> getAnnotationsByName(java.lang.String annotationName)
PQueryHeader
getAnnotationsByName
in interface PQueryHeader
public PAnnotation getFirstAnnotationByName(java.lang.String annotationName)
PQueryHeader
getFirstAnnotationByName
in interface PQueryHeader
public java.lang.String getFullyQualifiedName()
PQueryHeader
getFullyQualifiedName
in interface PQueryHeader
public java.util.List<java.lang.String> getParameterNames()
PQueryHeader
getParameterNames
in interface PQueryHeader
public java.util.List<PParameter> getParameters()
PQueryHeader
getParameters
in interface PQueryHeader
public java.lang.Integer getPositionOfParameter(java.lang.String parameterName)
PQueryHeader
getPositionOfParameter
in interface PQueryHeader