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 |
Constructor and Description |
---|
BasePQuery() |
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.
|
void |
ensureInitializedSneaky() |
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.
|
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.
|
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, wait
getFullyQualifiedName, getParameters
protected PQuery.PQueryStatus status
protected java.util.List<PProblem> pProblems
public java.lang.Integer getPositionOfParameter(java.lang.String parameterName)
PQueryHeader
getPositionOfParameter
in interface PQueryHeader
protected void setStatus(PQuery.PQueryStatus newStatus)
protected void addError(PProblem problem)
public PQuery.PQueryStatus getStatus()
PQuery
public java.util.List<PProblem> getPProblems()
PQuery
TODO: formulate invariant connecting PQuery.getPProblems()
and PQuery.getStatus()
.
getPProblems
in interface PQuery
public boolean isMutable()
PQuery
IllegalStateException
by
the execution of PQuery.checkMutability()
.public void checkMutability() throws java.lang.IllegalStateException
PQuery
PQuery.getStatus()
implementation, and in case of problems an IllegalStateException
is thrown.checkMutability
in interface PQuery
java.lang.IllegalStateException
public 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 PQuery
protected void addAnnotation(PAnnotation annotation)
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.util.List<java.lang.String> getParameterNames()
PQueryHeader
getParameterNames
in interface PQueryHeader
public java.util.Set<PQuery> getDirectReferredQueries()
PQuery
getDirectReferredQueries
in interface PQuery
public java.util.Set<PQuery> getAllReferredQueries()
PQuery
getAllReferredQueries
in interface PQuery
public java.util.List<java.lang.Object> publishedAs()
PQuery
Intended 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 PQuery
public java.util.Set<TypeJudgement> getTypeGuarantees()
PQuery
At 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 PQuery
public PDisjunction getDisjunctBodies()
PQuery
getDisjunctBodies
in interface PQuery
public final void ensureInitialized() throws QueryInitializationException
PQuery
ensureInitialized
in interface PQuery
QueryInitializationException
- if initialization of query specification failspublic final void ensureInitializedSneaky()
protected final void setBodies(java.util.Set<PBody> bodies)
protected abstract java.util.Set<PBody> doGetContainedBodies() throws QueryInitializationException
QueryInitializationException
public java.lang.String toString()
toString
in class java.lang.Object