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
|
/*****************************************************************************
* Copyright (c) 2013 CEA LIST and others.
*
* 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:
* CEA LIST - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.uml.search.ui.query;
import java.util.Collection;
import org.eclipse.emf.common.util.URI;
/**
* A pluggable provider of query implementations for URIs in different domains (workspace, CDO repositories, etc.).
* Providers are registered with a priority ordering. The first provider that returns a query for a given URI wins;
* lower-priority providers are not consulted.
*/
public interface IPapyrusQueryProvider {
/**
* Asks whether this provider can query a resource (or resources) identified by the given {@code scope} URI.
* This method is used to partition the overall search scope by query provider.
*
* @param scope
* a URI identifying one or more model resources in the workspace or elsewhere
*
* @return whether I can provide a query on this scope. If I can, I had better be prepared to supply one {@linkplain #createSimpleSearchQuery(String, boolean, boolean, boolean, Collection) when asked}
*
* @see #createSimpleSearchQuery(String, boolean, boolean, boolean, Collection)
* @see #createAdvancedSearchQuery(String, boolean, boolean, Collection, Collection)
*/
boolean canProvideFor(URI scope);
/**
* Creates a simple text-based search query.
*
* @param queryInfo
* the query parameters
*
* @return the simple (for the user!) search query
*/
AbstractPapyrusQuery createSimpleSearchQuery(QueryInfo queryInfo);
/**
* Creates an advanced text-based search query.
*
* @param queryInfo
* the query parameters
*
* @return the advanced (for the user!) search query
*/
AbstractPapyrusQuery createAdvancedSearchQuery(QueryInfo queryInfo);
//
// Nested types
//
}
|