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 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 made
        parameters - the request parameters containing the query (@see getQueryParameterNames()
        diagnostics - a SRUDiagnosticList for storing fatal and non-fatal diagnostics
        Returns:
        the parsed query or null if the query could not be parsed