public abstract class BaseQuerySpecification<Matcher extends IncQueryMatcher<? extends IPatternMatch>> extends java.lang.Object implements IQuerySpecification<Matcher>
Constructor and Description |
---|
BaseQuerySpecification(PQuery wrappedPQuery)
Instantiates query specification for the given internal query representation.
|
Modifier and Type | Method and Description |
---|---|
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(IncQueryEngine engine)
Initializes the pattern matcher within an existing
IncQueryEngine . |
Matcher |
getMatcher(org.eclipse.emf.common.notify.Notifier emfRoot)
Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
|
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
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreferredScopeClass, newEmptyMatch, newMatch
public BaseQuerySpecification(PQuery wrappedPQuery)
public PQuery getInternalQueryRepresentation()
IQuerySpecification
getInternalQueryRepresentation
in interface IQuerySpecification<Matcher extends IncQueryMatcher<? extends IPatternMatch>>
public Matcher getMatcher(org.eclipse.emf.common.notify.Notifier emfRoot) throws IncQueryException
IQuerySpecification
The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
The match set will be incrementally refreshed upon updates from this scope.
The matcher will be created within the managed IncQueryEngine
belonging to the EMF model root, so
multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
getMatcher
in interface IQuerySpecification<Matcher extends IncQueryMatcher<? extends IPatternMatch>>
emfRoot
- the root of the EMF tree where the pattern matcher will operate. Recommended: Resource or ResourceSet.IncQueryException
- if an error occurs during pattern matcher creationpublic Matcher getMatcher(IncQueryEngine engine) throws IncQueryException
IQuerySpecification
IncQueryEngine
. 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 IncQueryMatcher<? extends IPatternMatch>>
engine
- the existing IncQuery engine in which this matcher will be created.IncQueryException
- if an error occurs during pattern matcher creationpublic 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