org.apache.wink.common.model.opensearch
Class OpenSearchQuery

java.lang.Object
  extended by org.apache.wink.common.model.opensearch.OpenSearchQuery

public class OpenSearchQuery
extends java.lang.Object

The "Query" element per OpenSearch specification

 The "Query" element
 
 Describes a specific search request that can be made by the search client.
 
     Attributes:
 
         role - Contains a string identifying how the search client should interpret the search request defined by this Query element.
 
             Restrictions: See the role values specification for allowed role values. 
             Requirements: This attribute is required. 
 
         title - Contains a human-readable plain text string describing the search request.
 
             Restrictions: The value must contain 256 or fewer characters of plain text. The value must not contain HTML or other markup. 
             Requirements: This attribute is optional. 
 
         totalResults - Contains the expected number of results to be found if the search request were made.
 
             Restrictions: The value is a non-negative integer. 
             Requirements: This attribute is optional. 
 
         searchTerms - Contains the value representing the "searchTerms" as an OpenSearch 1.1 parameter.
 
             Restrictions: See the "searchTerms" parameter. 
             Requirements: This attribute is optional. 
 
         count - Contains the value representing the "count" as a OpenSearch 1.1 parameter.
 
             Restrictions: See the "count" parameter. 
             Requirements: This attribute is optional. 
 
         startIndex - Contains the value representing the "startIndex" as an OpenSearch 1.1 parameter.
 
             Restrictions: See the "startIndex" parameter. 
             Requirements: This attribute is optional. 
 
         startPage - Contains the value representing the "startPage" as an OpenSearch 1.1 parameter.
 
             Restrictions: See the "startPage" parameter. 
             Requirements: This attribute is optional. 
 
         language - Contains the value representing the "language" as an OpenSearch 1.1 parameter.
 
             Restrictions: See the "language" parameter. 
             Requirements: This attribute is optional. 
 
         inputEncoding - Contains the value representing the "inputEncoding" as an OpenSearch 1.1 parameter.
 
             Restrictions: See the "inputEncoding" parameter. 
             Requirements: This attribute is optional. 
 
         outputEncoding - Contains the value representing the "outputEncoding" as an OpenSearch 1.1 parameter.
 
             Restrictions: See the "outputEncoding" parameter. 
             Requirements: This attribute is optional. 
 
   Example:
 
     <Query role="example" searchTerms="cat" />
  
  
 o Query element extensibility
 
   The Query element may contain additional attributes if the extended attributes are associated with a namespace. Search clients should interpret extended attributes to represent the corresponding template parameter by the same name in the specified namespace.
 
   Example of a Query element representing a search request that contains an extended attribute that corresponds to an extended search parameter:
 
   <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                        xmlns:custom="http://example.com/opensearchextensions/1.0/">
     <Url type="text/html"
          template="http://example.com/search?color={custom:color?}" />
     <Query role="example"  custom:color="blue" />
     <!-- ... -->
   </OpenSearchDescription>
 
 o Role values
 
   A role value consists of an optional prefix followed by the local role value. If the prefix is present it will be separated from the local role value with the ":" character. All role values are associated with a namespace, either implicitly in the case of local role values, or explicitly via a prefix in the case of fully qualified role values.
   Role extensibility
 
   The role attribute may take on values beyond those specified in this document provided they are fully qualified with a prefix and associated with a declared namespace. Clients that encounter unrecognized role values should continue to process the document as if the Query element containing the unrecognized role value did not appear.
   Role prefix
 
   A role prefix associates a local role name with a namespace. All prefixes must be previously declared as an XML namespace prefix on the containing Query element or ancestor elements.
   Local role values
 
   Local role values are not preceded by a prefix. Local role values are associated with the OpenSearch 1.1 namespace.
 
   The following role values are identified with the OpenSearch 1.1 namespace. The list is exhaustive; only the role values listed below may appear in the OpenSearch 1.1 namespace.
 
   Role values:
 
     "request"
 
         Represents the search query that can be performed to retrieve the same set of search results. 
 
     "example"
 
         Represents a search query that can be performed to demonstrate the search engine. 
 
     "related"
 
         Represents a search query that can be performed to retrieve similar but different search results. 
 
     "correction"
 
         Represents a search query that can be performed to improve the result set, such as with a spelling correction. 
 
     "subset"
 
         Represents a search query that will narrow the current set of search results. 
 
     "superset"
 
         Represents a search query that will broaden the current set of search results. 
 
 
   Example of a local role value:
 
    <Query role="related" 
         title="A related search"
         searchTerms="tiger" />
 
 o Fully qualified role values
 
   Fully qualified role values are preceded by a prefix. Fully qualified role values are associated with the namespace identified by the prefix on the containing Query element or ancestor elements.
 
   Example of a fully qualified role value:
 
    <Query xmlns:custom="http://example.com/opensearchextensions/1.0/"
         role="custom:synonym"
         title="Synonyms of 'cat'"
         searchTerms="feline" />
 
 


Nested Class Summary
static class OpenSearchQuery.QueryRole
           
 
Field Summary
protected  java.math.BigInteger count
           
protected  java.lang.String inputEncoding
           
protected  java.lang.String language
           
protected  java.lang.String outputEncoding
           
protected  java.lang.String role
           
protected  java.lang.String searchTerms
           
protected  java.math.BigInteger startIndex
           
protected  java.math.BigInteger startPage
           
protected  java.lang.String title
           
protected  java.math.BigInteger totalResults
           
 
Constructor Summary
OpenSearchQuery()
           
 
Method Summary
 java.math.BigInteger getCount()
          Gets the value of the count property.
 java.lang.String getInputEncoding()
          Gets the value of the inputEncoding property.
 java.lang.String getLanguage()
          Gets the value of the language property.
 java.util.Map<javax.xml.namespace.QName,java.lang.String> getOtherAttributes()
          Gets a map that contains attributes that aren't bound to any typed property on this class.
 java.lang.String getOutputEncoding()
          Gets the value of the outputEncoding property.
 java.lang.String getRole()
          Gets the value of the role property.
 java.lang.String getSearchTerms()
          Gets the value of the searchTerms property.
 java.math.BigInteger getStartIndex()
          Gets the value of the startIndex property.
 java.math.BigInteger getStartPage()
          Gets the value of the startPage property.
 java.lang.String getTitle()
          Gets the value of the title property.
 java.math.BigInteger getTotalResults()
          Gets the value of the totalResults property.
 void setCount(java.math.BigInteger value)
          Sets the value of the count property.
 void setInputEncoding(java.lang.String value)
          Sets the value of the inputEncoding property.
 void setLanguage(java.lang.String value)
          Sets the value of the language property.
 void setOutputEncoding(java.lang.String value)
          Sets the value of the outputEncoding property.
 void setRole(java.lang.String value)
          Sets the value of the role property.
 void setSearchTerms(java.lang.String value)
          Sets the value of the searchTerms property.
 void setStartIndex(java.math.BigInteger value)
          Sets the value of the startIndex property.
 void setStartPage(java.math.BigInteger value)
          Sets the value of the startPage property.
 void setTitle(java.lang.String value)
          Sets the value of the title property.
 void setTotalResults(java.math.BigInteger value)
          Sets the value of the totalResults property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

role

protected java.lang.String role

searchTerms

protected java.lang.String searchTerms

title

protected java.lang.String title

totalResults

protected java.math.BigInteger totalResults

count

protected java.math.BigInteger count

startPage

protected java.math.BigInteger startPage

startIndex

protected java.math.BigInteger startIndex

language

protected java.lang.String language

inputEncoding

protected java.lang.String inputEncoding

outputEncoding

protected java.lang.String outputEncoding
Constructor Detail

OpenSearchQuery

public OpenSearchQuery()
Method Detail

getRole

public java.lang.String getRole()
Gets the value of the role property.

Returns:
possible object is String

setRole

public void setRole(java.lang.String value)
Sets the value of the role property.

Parameters:
value - allowed object is String

getSearchTerms

public java.lang.String getSearchTerms()
Gets the value of the searchTerms property.

Returns:
possible object is String

setSearchTerms

public void setSearchTerms(java.lang.String value)
Sets the value of the searchTerms property.

Parameters:
value - allowed object is String

getTitle

public java.lang.String getTitle()
Gets the value of the title property.

Returns:
possible object is String

setTitle

public void setTitle(java.lang.String value)
Sets the value of the title property.

Parameters:
value - allowed object is String

getTotalResults

public java.math.BigInteger getTotalResults()
Gets the value of the totalResults property.

Returns:
possible object is BigInteger

setTotalResults

public void setTotalResults(java.math.BigInteger value)
Sets the value of the totalResults property.

Parameters:
value - allowed object is BigInteger

getCount

public java.math.BigInteger getCount()
Gets the value of the count property.

Returns:
possible object is BigInteger

setCount

public void setCount(java.math.BigInteger value)
Sets the value of the count property.

Parameters:
value - allowed object is BigInteger

getStartPage

public java.math.BigInteger getStartPage()
Gets the value of the startPage property.

Returns:
possible object is BigInteger

setStartPage

public void setStartPage(java.math.BigInteger value)
Sets the value of the startPage property.

Parameters:
value - allowed object is BigInteger

getStartIndex

public java.math.BigInteger getStartIndex()
Gets the value of the startIndex property.

Returns:
possible object is BigInteger

setStartIndex

public void setStartIndex(java.math.BigInteger value)
Sets the value of the startIndex property.

Parameters:
value - allowed object is BigInteger

getLanguage

public java.lang.String getLanguage()
Gets the value of the language property.

Returns:
possible object is String

setLanguage

public void setLanguage(java.lang.String value)
Sets the value of the language property.

Parameters:
value - allowed object is String

getInputEncoding

public java.lang.String getInputEncoding()
Gets the value of the inputEncoding property.

Returns:
possible object is String

setInputEncoding

public void setInputEncoding(java.lang.String value)
Sets the value of the inputEncoding property.

Parameters:
value - allowed object is String

getOutputEncoding

public java.lang.String getOutputEncoding()
Gets the value of the outputEncoding property.

Returns:
possible object is String

setOutputEncoding

public void setOutputEncoding(java.lang.String value)
Sets the value of the outputEncoding property.

Parameters:
value - allowed object is String

getOtherAttributes

public java.util.Map<javax.xml.namespace.QName,java.lang.String> getOtherAttributes()
Gets a map that contains attributes that aren't bound to any typed property on this class.

the map is keyed by the name of the attribute and the value is the string value of the attribute. the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.

Returns:
always non-null


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.