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

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

public class OpenSearchDescription
extends java.lang.Object

The "OpenSearchDescription" element per OpenSearch specification

 The "OpenSearchDescription" element
 
 The root node of the OpenSearch description document.
     
       Parent: None 
       Requirements: The element must appear exactly once as the root node of the document. 
     
   Example:
     
    <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
       <!--- ... --->
    </OpenSearchDescription>
     
 o The "ShortName" element
     
     Contains a brief human-readable title that identifies this search engine.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must contain 16 or fewer characters of plain text. The value must not contain HTML or other markup. 
         Requirements: This element must appear exactly once. 
     
     Example:
     
      <ShortName>Web Search</ShortName>
     
 o The "Description" element
     
     Contains a human-readable text description of the search engine.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must contain 1024 or fewer characters of plain text. The value must not contain HTML or other markup. 
         Requirements: This element must appear exactly once. 
     
     Example:
     
      <Description>Use Example.com to search the Web.</Description>
     
 o The "Url" element
     
     Describes an interface by which a search client can make search requests of the search engine.
     
     OpenSearch provides support for both index-based and page-based search engines. By default, both the first search result and the first page of search results are numbered "1". Search engines can use the "indexOffset" and "pageOffset" attributes to inform search clients of different starting values.
     
         Parent: OpenSearchDescription 
         Attributes:
     
             template - Contains the search URL template to be processed according to the OpenSearch URL template syntax.
     
                 Requirements: This attribute is required. 
     
             type - Contains the MIME type of the search result format.
     
                 Restrictions: The value must be a valid MIME type. 
                 Requirements: This attribute is required. 
     
             indexOffset - Contains the index number of the first search result.
     
                 Restrictions: The value must be an integer. 
                 Default: "1" 
                 Requirements: This attribute is optional. 
     
             pageOffset - Contains the page number of the first set of search results.
     
                 Restrictions: The value must be an integer. 
                 Default: "1". 
                 Requirements: This attribute is optional. 
     
         Requirements: This element must appear one or more times. 
     
     
     Example of a Url element describing the interface used to retrieve search results over RSS:
     
      <Url type="application/rss+xml"
           template="http://example.com/?q={searchTerms}&pw={startPage?}" />
     
     Example of a Url element describing the interface used to retrieve 0-based search results over XHTML:
     
      <Url type="application/xhtml+xml"
           indexOffset="0"
           template="http://example.com/search?q={searchTerms}&start={startIndex?}" />
     
 o The "Contact" element
     
     Contains an email address at which the maintainer of the description document can be reached.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must conform to the requirements of Section 3.4.1 "Addr-spec specification" in RFC 2822. 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <Contact>admin@example.com</Contact>
     
 o The "Tags" element
     
     Contains a set of words that are used as keywords to identify and categorize this search content. Tags must be a single word and are delimited by the space character (' ').
     
         Parent: OpenSearchDescription 
         Restrictions: The value must contain 256 or fewer characters of plain text. The value must not contain HTML or other markup. 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <Tags>example web</Tags>
     
 o The "LongName" element
     
     Contains an extended human-readable title that identifies this search engine.
     
     Search clients should use the value of the ShortName element if this element is not available.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must contain 48 or fewer characters of plain text. The value must not contain HTML or other markup. 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <LongName>Example.com Web Search</LongName>
     
 o The "Image" element
     
     Contains a URL that identifies the location of an image that can be used in association with this search content.
     
     Image sizes are offered as a hint to the search client. The search client will chose the most appropriate image for the available space and should give preference to those listed first in the OpenSearch description document. Square aspect ratios are recommended. When possible, search engines should offer a 16x16 image of type "image/x-icon" or "image/vnd.microsoft.icon" (the Microsoft ICON format) and a 64x64 image of type "image/jpeg" or "image/png".
     
         Parent: OpenSearchDescription 
         Attributes:
     
             height - Contains the height, in pixels, of this image.
     
                 Restrictions: The value must be a non-negative integer. 
                 Requirements: This attribute is optional. 
     
             width - Contains the width, in pixels, of this image.
     
                 Restrictions: The value must be a non-negative integer. 
                 Requirements: This attribute is optional. 
     
             type - Contains the the MIME type of this image.
     
                 Restrictions: The value must be a valid MIME type. 
                 Requirements: This attribute is optional. 
     
         Restrictions: The value must be a URI. 
         Requirements: This element may appear zero, one, or more times. 
     
     Example:
     
      <Image height="16" width="16" type="image/x-icon">http://example.com/favicon.ico</Image>
      
      <Image height="64" width="64" type="image/png">http://example.com/websearch.png</Image>
     
 o The "Query" element
     
     Defines a search query that can be performed by search clients. Please see the OpenSearch Query element specification for more information.
     
     OpenSearch description documents should include at least one Query element of role="example" that is expected to return search results. Search clients may use this example query to validate that the search engine is working properly.
     
         Parent: OpenSearchDescription 
         Requirements: This element may appear zero or more times. 
     
     Example:
     
      <Query role="example" searchTerms="cat" />
     
 o The "Developer" element
     
     Contains the human-readable name or identifier of the creator or maintainer of the description document.
     
     The developer is the person or entity that created the description document, and may or may not be the owner, author, or copyright holder of the source of the content itself.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must contain 64 or fewer characters of plain text. The value must not contain HTML or other markup. 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <Developer>Example.com Development Team</Developer>
     
 o The "Attribution" element
     
     Contains a list of all sources or entities that should be credited for the content contained in the search feed.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must contain 256 or fewer characters of plain text. The value must not contain HTML or other markup. 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <Attribution>Search data copyright Example.com, Inc.</Attribution>
     
 o The "SyndicationRight" element
     
     Contains a value that indicates the degree to which the search results provided by this search engine can be queried, displayed, and redistributed.
     
         Parent: OpenSearchDescription 
         Values: The value must be one of the following strings (case insensitive):
     
             "open" -
     
                 The search client may request search results. 
                 The search client may display the search results to end users. 
                 The search client may send the search results to other search clients. 
     
             "limited" -
     
                 The search client may request search results. 
                 The search client may display the search results to end users. 
                 The search client may not send the search results to other search clients. 
     
             "private" -
     
                 The search client may request search results. 
                 The search client may not display the search results to end users. 
                 The search client may not send the search results to other search clients. 
     
             "closed" -
     
                 The search client may not request search results. 
     
         Default: "open" 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <SyndicationRight>open</SyndicationRight>
     
 o The "AdultContent" element
     
     Contains a boolean value that should be set to true if the search results may contain material intended only for adults.
     
     As there are no universally applicable guidelines as to what constitutes "adult" content, the search engine should make a good faith effort to indicate when there is a possibility that search results may contain material inappropriate for all audiences.
     
         Parent: OpenSearchDescription 
         Values:
     
             The values "false", "FALSE", "0", "no", and "NO" will be considered boolean FALSE; all other strings will be considered boolean TRUE. 
     
         Default: "false" 
         Requirements: This element may appear zero or one time. 
     
     Example:
     
      <AdultContent>false</AdultContent>
     
 o The "Language" element
     
     Contains a string that indicates that the search engine supports search results in the specified language.
     
     An OpenSearch description document should include one "Language" element for each language that the search engine supports. If the search engine also supports queries for any arbitrary language then the OpenSearch description document should include a Language element with a value of "*". The "language" template parameter in the OpenSearch URL template can be used to allow the search client to choose among the available languages.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must conform to the XML 1.0 Language Identification, as specified by RFC 3066. In addition, the value of "*" will signify that the search engine does not restrict search results to any particular language. 
         Default: "*". 
         Requirements: This element may appear zero, one, or more times. 
     
     Example:
     
      <Language>en-us</Language>
      
      <Language>*</Language>
     
 o The "InputEncoding" element
     
     Contains a string that indicates that the search engine supports search requests encoded with the specified character encoding.
     
     An OpenSearch description document should include one "InputEncoding" element for each character encoding that can be used to encode search requests. The "inputEncoding" template parameter in the OpenSearch URL template can be used to require the search client to identify which encoding is being used to encode the current search request.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must conform to the XML 1.0 Character Encodings, as specified by the IANA Character Set Assignments. 
         Default: "UTF-8". 
         Requirements: This element may appear zero, one, or more times. 
     
     Example:
     
      <InputEncoding>UTF-8</InputEncoding>
     
 o The "OutputEncoding" element
     
     Contains a string that indicates that the search engine supports search responses encoded with the specified character encoding.
     
     An OpenSearch description document should include one "OutputEncoding" element for each character encoding that can be used to encode search responses. The "outputEncoding" template parameter in the OpenSearch URL template can be used to allow the search client to choose a character encoding in the search response.
     
         Parent: OpenSearchDescription 
         Restrictions: The value must conform to the XML 1.0 Character Encodings, as specified by the IANA Character Set Assignments. 
         Default: "UTF-8". 
         Requirements: This element may appear zero, one, or more times. 
     
     Example:
     
      <OutputEncoding>UTF-8</OutputEncoding>
 


Field Summary
protected  java.lang.String adultContent
           
protected  java.lang.String attribution
           
protected  java.lang.String contact
           
protected  java.lang.String description
           
protected  java.lang.String developer
           
protected  java.util.List<OpenSearchImage> image
           
protected  java.util.List<java.lang.String> inputEncoding
           
protected  java.util.List<java.lang.String> language
           
protected  java.lang.String longName
           
protected  java.util.List<java.lang.String> outputEncoding
           
protected  java.util.List<OpenSearchQuery> query
           
protected  java.lang.String shortName
           
protected  java.lang.String syndicationRight
           
protected  java.lang.String tags
           
protected  java.util.List<OpenSearchUrl> url
           
 
Constructor Summary
OpenSearchDescription()
           
 
Method Summary
 void addInputEncoding(java.lang.String encoding)
          Adds InputEncoding to the list of supported Input Encoding
 void addLanguage(java.lang.String language)
          Add "Language".
 void addNewImage(OpenSearchImage openSearchImage)
          Adds new Image to the list
 void addOutputEncoding(java.lang.String encoding)
          Adds OutputEncoding to the list of supported Output Encoding
 void addQuery(OpenSearchQuery openSearchQuery)
          Adds OpenSearchQuery to the list of Open Search Queries
 void addUrl(OpenSearchUrl openSearchUrl)
          Adds OpenSearchUrl to the list of Open Search Urls.
 java.lang.String getAdultContent()
          Gets the value of the adultContent property.
 java.lang.String getAttribution()
          Gets the value of the attribution property.
 java.lang.String getContact()
          Gets the value of the contact property.
 java.lang.String getDescription()
          Gets the value of the description property.
 java.lang.String getDeveloper()
          Gets the value of the developer property.
 java.util.List<OpenSearchImage> getImage()
          Gets the value of the image property.
 java.util.List<java.lang.String> getInputEncoding()
          Gets the value of the inputEncoding property.
 java.util.List<java.lang.String> getLanguage()
          Gets the value of the language property.
 java.lang.String getLongName()
          Gets the value of the longName property.
static javax.xml.bind.Marshaller getMarshaller()
           
 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.util.List<java.lang.String> getOutputEncoding()
          Gets the value of the outputEncoding property.
 java.util.List<OpenSearchQuery> getQuery()
          Gets the value of the query property.
 java.lang.String getShortName()
          Gets the value of the shortName property.
 java.lang.String getSyndicationRight()
          Gets the value of the syndicationRight property.
 java.lang.String getTags()
          Gets the value of the tags property.
static javax.xml.bind.Unmarshaller getUnmarshaller()
           
 java.util.List<OpenSearchUrl> getUrl()
          Gets the value of the url property.
 void setAdultContent(java.lang.String value)
          Sets the value of the adultContent property.
 void setAttribution(java.lang.String value)
          Sets the value of the attribution property.
 void setContact(java.lang.String value)
          Sets the value of the contact property.
 void setDescription(java.lang.String value)
          Sets the value of the description property.
 void setDeveloper(java.lang.String value)
          Sets the value of the developer property.
 void setLongName(java.lang.String value)
          Sets the value of the longName property.
 void setShortName(java.lang.String value)
          Sets the value of the shortName property.
 void setSyndicationRight(java.lang.String value)
          Sets the value of the syndicationRight property.
 void setTags(java.lang.String value)
          Sets the value of the tags property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shortName

protected java.lang.String shortName

description

protected java.lang.String description

tags

protected java.lang.String tags

contact

protected java.lang.String contact

url

protected java.util.List<OpenSearchUrl> url

longName

protected java.lang.String longName

image

protected java.util.List<OpenSearchImage> image

query

protected java.util.List<OpenSearchQuery> query

developer

protected java.lang.String developer

attribution

protected java.lang.String attribution

syndicationRight

protected java.lang.String syndicationRight

adultContent

protected java.lang.String adultContent

language

protected java.util.List<java.lang.String> language

outputEncoding

protected java.util.List<java.lang.String> outputEncoding

inputEncoding

protected java.util.List<java.lang.String> inputEncoding
Constructor Detail

OpenSearchDescription

public OpenSearchDescription()
Method Detail

getMarshaller

public static javax.xml.bind.Marshaller getMarshaller()

getUnmarshaller

public static javax.xml.bind.Unmarshaller getUnmarshaller()

getShortName

public java.lang.String getShortName()
Gets the value of the shortName property.

Returns:
possible object is String

setShortName

public void setShortName(java.lang.String value)
Sets the value of the shortName property.

Parameters:
value - allowed object is String

getDescription

public java.lang.String getDescription()
Gets the value of the description property.

Returns:
possible object is String

setDescription

public void setDescription(java.lang.String value)
Sets the value of the description property.

Parameters:
value - allowed object is String

getTags

public java.lang.String getTags()
Gets the value of the tags property.

Returns:
possible object is String

setTags

public void setTags(java.lang.String value)
Sets the value of the tags property.

Parameters:
value - allowed object is String

getContact

public java.lang.String getContact()
Gets the value of the contact property.

Returns:
possible object is String

setContact

public void setContact(java.lang.String value)
Sets the value of the contact property.

Parameters:
value - allowed object is String

getUrl

public java.util.List<OpenSearchUrl> getUrl()
Gets the value of the url property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the url property.

For example, to add a new item, do as follows:

 getUrl().add(newItem);
 

Objects of the following type(s) are allowed in the list OpenSearchUrl


addUrl

public void addUrl(OpenSearchUrl openSearchUrl)
Adds OpenSearchUrl to the list of Open Search Urls.

Parameters:
openSearchUrl - possible object is OpenSearchUrl

getLongName

public java.lang.String getLongName()
Gets the value of the longName property.

Returns:
possible object is String

setLongName

public void setLongName(java.lang.String value)
Sets the value of the longName property.

Parameters:
value - allowed object is String

getImage

public java.util.List<OpenSearchImage> getImage()
Gets the value of the image property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the image property.

For example, to add a new item, do as follows:

 getImage().add(newItem);
 

Objects of the following type(s) are allowed in the list OpenSearchImage


addNewImage

public void addNewImage(OpenSearchImage openSearchImage)
Adds new Image to the list

Parameters:
openSearchImage - allowed object is OpenSearchImage

getQuery

public java.util.List<OpenSearchQuery> getQuery()
Gets the value of the query property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the query property.

For example, to add a new item, do as follows:

 getQuery().add(newItem);
 

Objects of the following type(s) are allowed in the list OpenSearchQuery


addQuery

public void addQuery(OpenSearchQuery openSearchQuery)
Adds OpenSearchQuery to the list of Open Search Queries

Parameters:
openSearchQuery - possible object is OpenSearchQuery

getDeveloper

public java.lang.String getDeveloper()
Gets the value of the developer property.

Returns:
possible object is String

setDeveloper

public void setDeveloper(java.lang.String value)
Sets the value of the developer property.

Parameters:
value - allowed object is String

getAttribution

public java.lang.String getAttribution()
Gets the value of the attribution property.

Returns:
possible object is String

setAttribution

public void setAttribution(java.lang.String value)
Sets the value of the attribution property.

Parameters:
value - allowed object is String

getSyndicationRight

public java.lang.String getSyndicationRight()
Gets the value of the syndicationRight property.

Returns:
possible object is String

setSyndicationRight

public void setSyndicationRight(java.lang.String value)
Sets the value of the syndicationRight property.

Parameters:
value - allowed object is String

getAdultContent

public java.lang.String getAdultContent()
Gets the value of the adultContent property.

Returns:
possible object is String

setAdultContent

public void setAdultContent(java.lang.String value)
Sets the value of the adultContent property.

Parameters:
value - allowed object is String

getLanguage

public java.util.List<java.lang.String> getLanguage()
Gets the value of the language property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the language property.

For example, to add a new item, do as follows:

 getLanguage().add(newItem);
 

Objects of the following type(s) are allowed in the list String


addLanguage

public void addLanguage(java.lang.String language)
Add "Language". Contains a string that indicates that the search engine supports search results in the specified language.

Parameters:
language - allowed object is String

getOutputEncoding

public java.util.List<java.lang.String> getOutputEncoding()
Gets the value of the outputEncoding property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the outputEncoding property.

For example, to add a new item, do as follows:

 getOutputEncoding().add(newItem);
 

Objects of the following type(s) are allowed in the list String


addOutputEncoding

public void addOutputEncoding(java.lang.String encoding)
Adds OutputEncoding to the list of supported Output Encoding

Parameters:
encoding - allowed object is String

getInputEncoding

public java.util.List<java.lang.String> getInputEncoding()
Gets the value of the inputEncoding property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the inputEncoding property.

For example, to add a new item, do as follows:

 getInputEncoding().add(newItem);
 

Objects of the following type(s) are allowed in the list String


addInputEncoding

public void addInputEncoding(java.lang.String encoding)
Adds InputEncoding to the list of supported Input Encoding

Parameters:
encoding - 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 The Apache Software Foundation. All Rights Reserved.