1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
/**
* Copyright (c) 2011, 2012 Mia-Software.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Gregoire Dupe (Mia-Software) - initial API and implementation
* Nicolas Bros (Mia-Software) - Bug 361617 - Deprecation of APIs for the old Facet metamodels
* Nicolas Bros (Mia-Software) - Bug 376941 - [EFacet] Facet operation arguments in Facet model
*/
package org.eclipse.papyrus.emf.facet.efacet.core.query;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.emf.facet.efacet.ParameterValue;
import org.eclipse.papyrus.emf.facet.efacet.Query;
import org.eclipse.papyrus.emf.facet.efacet.QueryResult;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.QueryException;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.QueryExecutionException;
/**
* This interface is the EMF Facet QueryEvaluator for query evaluation
*
* @deprecated use {@link IQueryImplementation} with the new eFacet2 metamodel (https://bugs.eclipse.org/bugs/show_bug.cgi?id=381227)
*/
@Deprecated
public interface IQueryEvaluator {
/**
* This method must be implemented by each sub class to evaluate a query
*
* @param query
* The query to evaluate
* @param context
* The model element on which the query is evaluated
* @param parameterValues
* The query parameter values, can be <code>null</code>
* @return A list of {@link QueryResult}s (one per evaluation)
* @throws QueryExecutionException
*/
public Object basicEvaluate(final Query query, EObject context,
final List<ParameterValue> parameterValues) throws QueryException;
/**
* Return whether to check the query result after its evaluation
*
* @return whether to check the query result after its evaluation
*/
public abstract boolean getCheckResultType();
/**
* Called when starting the evaluation of a query on one or several context
* elements (when
* {@link AbstractQueryEvaluator#evaluate(ModelQueryContext, List)} is
* called).
* <p>
* A subclass will receive in order:<br>
*
* <pre>
* startEvaluate()
* basicEvaluate(context1, parameters)
* basicEvaluate(context2, parameters)
* ...
* basicEvaluate(contextn, parameters)
* endEvaluate()
* </pre>
*
* </p>
*
* When evaluating a query on several context elements, basicEvaluate is
* called repeatedly with each context element. For some implementations
* that make use of a system with which you must establish a connection (e.g.
* a database) for each call, this is costly.
*
* The methods startEvaluate and endEvaluate satisfy this requirement
*
* @see {@link AbstractQueryEvaluator#endEvaluate()}
*/
public void startEvaluate();
/**
* Called when ending the evaluation of a query on one or several context
* elements.
* <p>
* A subclass will receive in order:<br>
*
* <pre>
* startEvaluate()
* basicEvaluate(context1, parameters)
* basicEvaluate(context2, parameters)
* ...
* basicEvaluate(contextn, parameters)
* endEvaluate()
* </pre>
*
* </p>
* When evaluating a query on several context elements, basicEvaluate is
* called repeatedly with each context element. For some implementations
* that make use of a system with which you must establish a connection
* (e.g. a database) for each call, this is costly.
*
* The methods startEvaluate and endEvaluate satisfy this requirement
*
* @see {@link AbstractQueryEvaluator#startEvaluate()}
*/
public void endEvaluate();
}
|