org.gcube.opensearch.opensearchoperator
Class QueryParser

java.lang.Object
  extended by org.gcube.opensearch.opensearchoperator.QueryParser

public class QueryParser
extends java.lang.Object

An OpenSearch query parser, responsible for parsing and processing an OpenSearch query and a set of fixed parameters. After processing, a mapping of parameter names and values both for query and fixed parameters, as well as a set of all namespaces present in the parameters are available

Author:
gerasimos.farantatos, NKUA

Constructor Summary
QueryParser(java.lang.String queryString, java.lang.String[] fixedParams)
          Creates a new instance and processes the query and fixed parameter strings
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getFixedParamsMap()
          Retrieves all fixed parameter name-value mappings
 java.lang.String getFixedTerms()
          Retrieves the fixed parameter corresponding to the searchTerms standard OpenSearch parameter
 java.util.Set<java.lang.String> getNamespaces()
          Retrieves all namespaces present in the OpenSearch query and the fixed parameters
 java.util.Map<java.lang.String,java.lang.String> getParams()
          Retrieves all parameter name-value mappings
 java.lang.String getTerms()
          Retrieves the search terms, as specified by the searchTerms standard OpenSearch parameter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryParser

public QueryParser(java.lang.String queryString,
                   java.lang.String[] fixedParams)
            throws java.io.UnsupportedEncodingException
Creates a new instance and processes the query and fixed parameter strings

Parameters:
queryString - The OpenSearch operator query string
fixedParams - The fixed parameters array
Throws:
java.io.UnsupportedEncodingException - If the encoding used to decode the encoded namespace prefixes is not supported
Method Detail

getTerms

public java.lang.String getTerms()
Retrieves the search terms, as specified by the searchTerms standard OpenSearch parameter

Returns:
The search terms

getParams

public java.util.Map<java.lang.String,java.lang.String> getParams()
Retrieves all parameter name-value mappings

Returns:
All parameters and their corresponding values

getFixedTerms

public java.lang.String getFixedTerms()
Retrieves the fixed parameter corresponding to the searchTerms standard OpenSearch parameter

Returns:
The fixed search terms

getFixedParamsMap

public java.util.Map<java.lang.String,java.lang.String> getFixedParamsMap()
Retrieves all fixed parameter name-value mappings

Returns:
All fixed parameters and their corresponding values

getNamespaces

public java.util.Set<java.lang.String> getNamespaces()
Retrieves all namespaces present in the OpenSearch query and the fixed parameters

Returns:
The namespaces found