public abstract class BasePQuery extends java.lang.Object implements PQuery
PQuery.PQueryStatus| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<PProblem> |
pProblems |
protected PQuery.PQueryStatus |
status |
protected PVisibility |
visibility |
| Constructor and Description |
|---|
BasePQuery(PVisibility visibility) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAnnotation(PAnnotation annotation) |
protected void |
addError(PProblem problem) |
void |
checkMutability()
Before a modification operation is executed, a mutability check is performed (via the
PQuery.getStatus()
implementation, and in case of problems an IllegalStateException is thrown. |
protected abstract java.util.Set<PBody> |
doGetContainedBodies()
Creates and returns the bodies of the query.
|
void |
ensureInitialized()
If the query definition is uninitialized, initializes it.
|
java.util.List<PAnnotation> |
getAllAnnotations()
Returns the list of annotations specified for this query
|
java.util.Set<PQuery> |
getAllReferredQueries()
Returns all queries required to evaluate this query (transitively).
|
java.util.List<PAnnotation> |
getAnnotationsByName(java.lang.String annotationName)
Returns the list of annotations with a specified name
|
java.util.Set<PQuery> |
getDirectReferredQueries()
Returns all queries directly referred in the constraints.
|
PDisjunction |
getDisjunctBodies()
Returns all bodies associated with the query in their canonical form.
|
QueryEvaluationHint |
getEvaluationHints()
Optional hints regarding the query evaluation strategy, to be interpreted by the query engine.
|
java.util.Optional<PAnnotation> |
getFirstAnnotationByName(java.lang.String annotationName)
Returns the first annotation with a specified name
|
java.util.List<java.lang.String> |
getParameterNames()
Return the list of parameter names
|
java.lang.Integer |
getPositionOfParameter(java.lang.String parameterName)
Returns the index of a named parameter
|
java.util.List<PProblem> |
getPProblems()
Returns a list describing the problems that were found in this query.
|
PQuery.PQueryStatus |
getStatus()
Returns the initialization status of the definition
|
java.util.Set<TypeJudgement> |
getTypeGuarantees()
Type information, expressed on query parameters, that all matches of the query are guaranteed to respect.
|
PVisibility |
getVisibility()
Returns the visibility information about the query.
|
boolean |
isMutable()
An option to check mutability of the query.
|
java.util.List<java.lang.Object> |
publishedAs()
Returns the end-user query specification API objects that wrap this query.
|
protected void |
setBodies(java.util.Set<PBody> bodies) |
void |
setEvaluationHints(QueryEvaluationHint hints) |
protected void |
setStatus(PQuery.PQueryStatus newStatus) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFullyQualifiedName, getParameter, getParameters, getSimpleNameprotected PQuery.PQueryStatus status
protected final PVisibility visibility
protected java.util.List<PProblem> pProblems
public BasePQuery(PVisibility visibility)
public java.lang.Integer getPositionOfParameter(java.lang.String parameterName)
PQueryHeadergetPositionOfParameter in interface PQueryHeaderprotected void setStatus(PQuery.PQueryStatus newStatus)
protected void addError(PProblem problem)
public PQuery.PQueryStatus getStatus()
PQuerypublic java.util.List<PProblem> getPProblems()
PQuery TODO: formulate invariant connecting PQuery.getPProblems() and PQuery.getStatus().
getPProblems in interface PQuerypublic boolean isMutable()
PQueryIllegalStateException by
the execution of PQuery.checkMutability().public void checkMutability()
PQueryPQuery.getStatus()
implementation, and in case of problems an IllegalStateException is thrown.checkMutability in interface PQuerypublic void setEvaluationHints(QueryEvaluationHint hints)
public QueryEvaluationHint getEvaluationHints()
PQuery To ensure the possibility of external overrides,
the evaluation engine should not directly consult this field,
but use an IQueryBackendHintProvider instead.
getEvaluationHints in interface PQueryprotected void addAnnotation(PAnnotation annotation)
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.util.List<java.lang.String> getParameterNames()
PQueryHeadergetParameterNames in interface PQueryHeaderpublic java.util.Set<PQuery> getDirectReferredQueries()
PQuerygetDirectReferredQueries in interface PQuerypublic java.util.Set<PQuery> getAllReferredQueries()
PQuerygetAllReferredQueries in interface PQuerypublic java.util.List<java.lang.Object> publishedAs()
PQueryIntended for traceability and debug purposes, not part of normal operation. Returned list is intended to be appended during query specification construction time.
publishedAs in interface PQuerypublic java.util.Set<TypeJudgement> getTypeGuarantees()
PQueryAt the very minimum, this should include the declared types of the parameters.
The type judgement tuples shall contain the parameter index, NOT the PParameter object.
getTypeGuarantees in interface PQuerypublic PDisjunction getDisjunctBodies()
PQuerygetDisjunctBodies in interface PQuerypublic final void ensureInitialized()
PQueryensureInitialized in interface PQueryprotected final void setBodies(java.util.Set<PBody> bodies)
protected abstract java.util.Set<PBody> doGetContainedBodies()
ViatraQueryRuntimeExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic PVisibility getVisibility()
PQueryHeadergetVisibility in interface PQueryHeader