Package eu.clarin.sru.server
Interface SRUQueryParser<T>
-
- Type Parameters:
T
- abstract syntax tree (object) for parsed queries.
- All Known Implementing Classes:
CQLQueryParser
,SearchTermsQueryParser
public interface SRUQueryParser<T>
Interface for implementing pluggable query parsers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>
getQueryParameterNames()
Get the list of query parameters.String
getQueryType()
Get the short name for supported query, e.g.String
getQueryTypeDefintion()
The URI for the for the query type’s definition.SRUQuery<T>
parseQuery(SRUVersion version, Map<String,String> parameters, SRUDiagnosticList diagnostics)
Parse a query into an abstract syntax treeboolean
supportsVersion(SRUVersion version)
Check if query is supported by a specific version of SRU/CQL
-
-
-
Method Detail
-
getQueryType
String getQueryType()
Get the short name for supported query, e.g. "cql".- Returns:
- the query short name
-
supportsVersion
boolean supportsVersion(SRUVersion version)
Check if query is supported by a specific version of SRU/CQL- Parameters:
version
- the version- Returns:
true
if version is supported,false
otherwise
-
getQueryTypeDefintion
String getQueryTypeDefintion()
The URI for the for the query type’s definition.- Returns:
- the URI for the for the query type’s definition.
-
getQueryParameterNames
List<String> getQueryParameterNames()
Get the list of query parameters.- Returns:
- the list of query parameters names.
-
parseQuery
SRUQuery<T> parseQuery(SRUVersion version, Map<String,String> parameters, SRUDiagnosticList diagnostics)
Parse a query into an abstract syntax tree- Parameters:
version
- the SRU version the request was madeparameters
- the request parameters containing the query (@seegetQueryParameterNames()
diagnostics
- aSRUDiagnosticList
for storing fatal and non-fatal diagnostics- Returns:
- the parsed query or
null
if the query could not be parsed
-
-