Class DefaultQueryFactory
- java.lang.Object
-
- com.atlassian.confluence.impl.search.v2.DefaultQueryFactory
-
- All Implemented Interfaces:
QueryFactory
public class DefaultQueryFactory extends Object implements QueryFactory
A default implementation of QueryFactory that maps query type keys to plugin module complete keys. Plugin modules must be of typeSearchQueryModuleDescriptor
.So the most common query types can have more readable seralized forms, any query type key that does not look like a plugin module complete key will be assumed to be a module in the "confluence.search.builtin" plugin. So, for example, looking up "inSpace" is the functional equivalent of looking up "confluence.search.builtin:inSpace".
-
-
Constructor Summary
Constructors Constructor Description DefaultQueryFactory(com.atlassian.plugin.PluginAccessor pluginAccessor)
Construct a new query factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchQuery
newQuery(String queryKey)
Generate a SearchQuery without parametersSearchQuery
newQuery(String queryKey, List parameters)
Generate a SearchQuery with parameters.
-
-
-
Method Detail
-
newQuery
public SearchQuery newQuery(String queryKey) throws InvalidQueryException
Description copied from interface:QueryFactory
Generate a SearchQuery without parameters- Specified by:
newQuery
in interfaceQueryFactory
- Parameters:
queryKey
- the key for that query type- Returns:
- the appropriate SearchQuery object
- Throws:
InvalidQueryException
- if no query can be found for that key, or a query can be found but it can not be constructed with no parameters.- See Also:
QueryFactory.newQuery(String)
-
newQuery
public SearchQuery newQuery(String queryKey, List parameters) throws InvalidQueryException
Description copied from interface:QueryFactory
Generate a SearchQuery with parameters. Parameters must be either String or SearchQuery instances.- Specified by:
newQuery
in interfaceQueryFactory
- Parameters:
queryKey
- the key for that query typeparameters
- the parameters for that query- Returns:
- the appropriate SearchQuery object
- Throws:
InvalidQueryException
- if no query can be found for that key, or a query can be found but it can not be constructed with the given parameters.- See Also:
QueryFactory.newQuery(String, List)
-
-