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.StringgetQueryType()Get the short name for supported query, e.g.StringgetQueryTypeDefintion()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 treebooleansupportsVersion(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:
trueif version is supported,falseotherwise
-
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- aSRUDiagnosticListfor storing fatal and non-fatal diagnostics- Returns:
- the parsed query or
nullif the query could not be parsed
-
-