org.eclipse.emf.facet.efacet.core.query
Interface IQueryImplementation

All Known Subinterfaces:
IQueryCollectionImplementation

public interface IQueryImplementation

Interface implemented by all EMF Facet query evaluators.

A query evaluator may choose to implement IQueryCollectionImplementation instead if it wants to improve the performance of evaluation on collections of elements.

Since:
0.2

Method Summary
 java.lang.Object getValue(Query query, DerivedTypedElement feature, EObject source, java.util.List<ParameterValue> parameterValues, IFacetManager facetManager)
          This method must be implemented by each sub class to evaluate a query
 boolean isCheckResultType()
          Return whether to check the type of the query result after its evaluation
 void setValue(Query query, DerivedTypedElement feature, EObject source, java.util.List<ParameterValue> parameterValues, java.lang.Object newValue)
          This method must be implemented by each sub class that allows to set the value of a derivedTypedElement using a query
 

Method Detail

getValue

java.lang.Object getValue(Query query,
                          DerivedTypedElement feature,
                          EObject source,
                          java.util.List<ParameterValue> parameterValues,
                          IFacetManager facetManager)
                          throws DerivedTypedElementException
This method must be implemented by each sub class to evaluate a query

Parameters:
query - The query to evaluate
feature - The feature or operation to get on the source
source - The model element on which the query is evaluated
parameterValues - The derived typed element's query parameter values (in the case of a FacetOperation); can be null
Returns:
the result, which can be either a single object or a collection of values depending on the multiplicity of the given derived typed element
Throws:
DerivedTypedElementException - if the query could not be evaluated correctly to get the value

setValue

void setValue(Query query,
              DerivedTypedElement feature,
              EObject source,
              java.util.List<ParameterValue> parameterValues,
              java.lang.Object newValue)
              throws DerivedTypedElementException
This method must be implemented by each sub class that allows to set the value of a derivedTypedElement using a query

Parameters:
query - The query that sets the value
feature - The derived typed element to set
source - The model element on which the derived typed element must be set
parameterValues - The query parameter values (in the case of a FacetOperation); can be null
newValue - the value to set on the derived typed element
Throws:
DerivedTypedElementException - if the query could not be evaluated correctly to set the value

isCheckResultType

boolean isCheckResultType()
Return whether to check the type of the query result after its evaluation

Normally, this is true, but the query evaluator can choose to skip the check, for example if the return type of the query can't be loaded.

Returns:
whether to check the type of the query result after its evaluation