org.gcube.opensearch.opensearchlibrary.queryelements
Class QueryElementDecorator

java.lang.Object
  extended by org.gcube.opensearch.opensearchlibrary.queryelements.QueryElementDecorator
All Implemented Interfaces:
QueryElement
Direct Known Subclasses:
GeoQueryElement, SRUQueryElement, TimeQueryElement

public abstract class QueryElementDecorator
extends Object
implements QueryElement


Field Summary
protected  QueryElement el
           
 
Constructor Summary
QueryElementDecorator(QueryElement el)
           
 
Method Summary
 boolean describesExampleQuery()
          Determines whethe the query element describes an example query
 String getCount()
          Returns the value of the count OpenSearch parameter contained in the query element
 String getInputEncoding()
          Returns the value of the inputEncoding OpenSearch parameter contained in the query element
 String getLanguage()
          Returns the value of the language OpenSearch parameter contained in the query element
 String getOutputEncoding()
          Returns the value of the outputEncoding OpenSearch parameter contained in the query element
 Map<String,String> getQueryParameters()
          Returns all parameters contained in the query element along with their corresponding values
 String getRole()
          Returns the role of the search request described in the query element
 String getSearchTerms()
          Returns the value of the searchTerms OpenSearch parameter contained in the query element
 String getStartIndex()
          Returns the value of the startIndex OpenSearch parameter contained in the query element
 String getStartPage()
          Returns the value of the startPage OpenSearch parameter contained in the query element
 String getTitle()
          Returns a description describing the search request described in the query element
 String getTotalResults()
          Returns the expected number of results that will be returned if the search request contained in the query element were made
 boolean isRoleSupported()
          Determines whether the query element supports the query role provided
 void parse()
          Processes a query element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

el

protected QueryElement el
Constructor Detail

QueryElementDecorator

public QueryElementDecorator(QueryElement el)
Method Detail

parse

public void parse()
           throws Exception
Processes a query element

Specified by:
parse in interface QueryElement
Throws:
Exception - If the query element is not valid according to the OpenSearch specification or in case of other error
See Also:
QueryElement.parse()

getRole

public String getRole()
               throws Exception
Returns the role of the search request described in the query element

Specified by:
getRole in interface QueryElement
Returns:
The role of the search request
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getRole()

getTitle

public String getTitle()
                throws Exception
Returns a description describing the search request described in the query element

Specified by:
getTitle in interface QueryElement
Returns:
A description of the search request
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getTitle()

getTotalResults

public String getTotalResults()
                       throws Exception
Returns the expected number of results that will be returned if the search request contained in the query element were made

Specified by:
getTotalResults in interface QueryElement
Returns:
The expected number of results
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getTotalResults()

getSearchTerms

public String getSearchTerms()
                      throws Exception
Returns the value of the searchTerms OpenSearch parameter contained in the query element

Specified by:
getSearchTerms in interface QueryElement
Returns:
The value of the searchTerms parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getSearchTerms()

getCount

public String getCount()
                throws Exception
Returns the value of the count OpenSearch parameter contained in the query element

Specified by:
getCount in interface QueryElement
Returns:
The value of the count parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getCount()

getStartIndex

public String getStartIndex()
                     throws Exception
Returns the value of the startIndex OpenSearch parameter contained in the query element

Specified by:
getStartIndex in interface QueryElement
Returns:
The value of the startIndex parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getStartIndex()

getStartPage

public String getStartPage()
                    throws Exception
Returns the value of the startPage OpenSearch parameter contained in the query element

Specified by:
getStartPage in interface QueryElement
Returns:
The value of the startPage parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getStartPage()

getLanguage

public String getLanguage()
                   throws Exception
Returns the value of the language OpenSearch parameter contained in the query element

Specified by:
getLanguage in interface QueryElement
Returns:
The value of the language parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getLanguage()

getInputEncoding

public String getInputEncoding()
                        throws Exception
Returns the value of the inputEncoding OpenSearch parameter contained in the query element

Specified by:
getInputEncoding in interface QueryElement
Returns:
The value of the inputEncoding parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getInputEncoding()

getOutputEncoding

public String getOutputEncoding()
                         throws Exception
Returns the value of the outputEncoding OpenSearch parameter contained in the query element

Specified by:
getOutputEncoding in interface QueryElement
Returns:
The value of the outputEncoding parameter
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.getOutputEncoding()

describesExampleQuery

public boolean describesExampleQuery()
                              throws Exception
Determines whethe the query element describes an example query

Specified by:
describesExampleQuery in interface QueryElement
Returns:
true if the query element describes an example query, false otherwise
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.describesExampleQuery()

getQueryParameters

public Map<String,String> getQueryParameters()
                                      throws Exception
Returns all parameters contained in the query element along with their corresponding values

Specified by:
getQueryParameters in interface QueryElement
Returns:
All parameters-value pairs contained in the query element
Throws:
Exception - In case of error
See Also:
QueryElement.getQueryParameters()

isRoleSupported

public boolean isRoleSupported()
                        throws Exception
Determines whether the query element supports the query role provided

Specified by:
isRoleSupported in interface QueryElement
Returns:
true if the query element supports the role provided, false otherwise
Throws:
Exception - If the query element is not initialized or in case of other error
See Also:
QueryElement.isRoleSupported()


Copyright © 2013. All Rights Reserved.