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() |
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
|
java.util.Optional<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
|
PVisibility |
getVisibility()
Returns the visibility information about the query.
|
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, waitgetPreferredScopeClass, newEmptyMatch, newMatchgetParameter, getSimpleNameprotected final PQuery wrappedPQuery
public BaseQuerySpecification(PQuery wrappedPQuery)
protected static ViatraQueryException processInitializerError(java.lang.ExceptionInInitializerError err)
protected abstract Matcher instantiate(ViatraQueryEngine engine)
public Matcher instantiate()
instantiate in interface IQuerySpecification<Matcher extends ViatraQueryMatcher<? extends IPatternMatch>>public PQuery getInternalQueryRepresentation()
IQuerySpecificationgetInternalQueryRepresentation in interface IQuerySpecification<Matcher extends ViatraQueryMatcher<? extends IPatternMatch>>public Matcher getMatcher(ViatraQueryEngine engine)
IQuerySpecificationViatraQueryEngine. 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.protected void ensureInitializedInternal()
public java.util.List<PAnnotation> getAllAnnotations()
PQueryHeadergetAllAnnotations in interface PQueryHeaderpublic java.util.List<PAnnotation> getAnnotationsByName(java.lang.String annotationName)
PQueryHeadergetAnnotationsByName in interface PQueryHeaderpublic java.util.Optional<PAnnotation> getFirstAnnotationByName(java.lang.String annotationName)
PQueryHeadergetFirstAnnotationByName in interface PQueryHeaderpublic java.lang.String getFullyQualifiedName()
PQueryHeadergetFullyQualifiedName in interface PQueryHeaderpublic java.util.List<java.lang.String> getParameterNames()
PQueryHeadergetParameterNames in interface PQueryHeaderpublic java.util.List<PParameter> getParameters()
PQueryHeadergetParameters in interface PQueryHeaderpublic java.lang.Integer getPositionOfParameter(java.lang.String parameterName)
PQueryHeadergetPositionOfParameter in interface PQueryHeaderpublic PVisibility getVisibility()
PQueryHeadergetVisibility in interface PQueryHeader