All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.wink.common.model.opensearch.OpenSearchDescription Maven / Gradle / Ivy

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.1-b02-fcs 
// See http://java.sun.com/xml/jaxb 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2008.09.15 at 01:17:47 PM IDT 
//

package org.apache.wink.common.model.opensearch;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;

import org.apache.wink.common.RestException;
import org.apache.wink.common.internal.i18n.Messages;
import org.apache.wink.common.internal.utils.JAXBUtils;

/**
 * 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>[email protected]</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>
 * 
*/ // @XmlRootElement(namespace = "http://a9.com/-/spec/opensearch/1.1/", name = // "Contact") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OpenSearchDescription", propOrder = {"shortName", "description", "tags", "contact", "url", "longName", "image", "query", "developer", "attribution", "syndicationRight", "adultContent", "language", "outputEncoding", "inputEncoding"}) public class OpenSearchDescription { @XmlElement(name = "ShortName", required = true) protected String shortName; @XmlElement(name = "Description", required = true) protected String description; @XmlElement(name = "Tags") protected String tags; @XmlElement(name = "Contact") protected String contact; @XmlElement(name = "Url", required = true) protected List url; @XmlElement(name = "LongName") protected String longName; @XmlElement(name = "Image") protected List image; @XmlElement(name = "Query") protected List query; @XmlElement(name = "Developer") protected String developer; @XmlElement(name = "Attribution") protected String attribution; @XmlElement(name = "SyndicationRight", defaultValue = "open") protected String syndicationRight; @XmlElement(name = "AdultContent") protected String adultContent; @XmlElement(name = "Language") protected List language; @XmlElement(name = "OutputEncoding", defaultValue = "UTF-8") protected List outputEncoding; @XmlElement(name = "InputEncoding", defaultValue = "UTF-8") protected List inputEncoding; @XmlAnyAttribute private Map otherAttributes = new HashMap(); // ============================ @XmlTransient private static final JAXBContext context; static { try { context = JAXBContext.newInstance(OpenSearchDescription.class.getPackage().getName()); } catch (JAXBException e) { throw new RestException(Messages.getMessage("failedToCreateJAXBContextFor", "OpenSearchDescription"), e); //$NON-NLS-1$ //$NON-NLS-2$ } } public static Marshaller getMarshaller() { return JAXBUtils.createMarshaller(context); } public static Unmarshaller getUnmarshaller() { return JAXBUtils.createUnmarshaller(context); } // ============================ /** * Gets the value of the shortName property. * * @return possible object is {@link String } */ public String getShortName() { return shortName; } /** * Sets the value of the shortName property. * * @param value allowed object is {@link String } */ public void setShortName(String value) { this.shortName = value; } /** * Gets the value of the description property. * * @return possible object is {@link String } */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value allowed object is {@link String } */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the tags property. * * @return possible object is {@link String } */ public String getTags() { return tags; } /** * Sets the value of the tags property. * * @param value allowed object is {@link String } */ public void setTags(String value) { this.tags = value; } /** * Gets the value of the contact property. * * @return possible object is {@link String } */ public String getContact() { return contact; } /** * Sets the value of the contact property. * * @param value allowed object is {@link String } */ public void setContact(String value) { this.contact = value; } /** * 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 * {@link OpenSearchUrl } */ public List getUrl() { if (url == null) { url = new ArrayList(); } return this.url; } /** * Adds OpenSearchUrl to the list of Open Search Urls. * * @param openSearchUrl possible object is {@link OpenSearchUrl} */ public void addUrl(OpenSearchUrl openSearchUrl) { getUrl().add(openSearchUrl); } /** * Gets the value of the longName property. * * @return possible object is {@link String } */ public String getLongName() { return longName; } /** * Sets the value of the longName property. * * @param value allowed object is {@link String } */ public void setLongName(String value) { this.longName = value; } /** * 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 * {@link OpenSearchImage } */ public List getImage() { if (image == null) { image = new ArrayList(); } return this.image; } /** * Adds new Image to the list * * @param openSearchImage allowed object is {@link OpenSearchImage } */ public void addNewImage(OpenSearchImage openSearchImage) { getImage().add(openSearchImage); } /** * 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 * {@link OpenSearchQuery } */ public List getQuery() { if (query == null) { query = new ArrayList(); } return this.query; } /** * Adds OpenSearchQuery to the list of Open Search Queries * * @param openSearchQuery possible object is {@link OpenSearchQuery } */ public void addQuery(OpenSearchQuery openSearchQuery) { getQuery().add(openSearchQuery); } /** * Gets the value of the developer property. * * @return possible object is {@link String } */ public String getDeveloper() { return developer; } /** * Sets the value of the developer property. * * @param value allowed object is {@link String } */ public void setDeveloper(String value) { this.developer = value; } /** * Gets the value of the attribution property. * * @return possible object is {@link String } */ public String getAttribution() { return attribution; } /** * Sets the value of the attribution property. * * @param value allowed object is {@link String } */ public void setAttribution(String value) { this.attribution = value; } /** * Gets the value of the syndicationRight property. * * @return possible object is {@link String } */ public String getSyndicationRight() { return syndicationRight; } /** * Sets the value of the syndicationRight property. * * @param value allowed object is {@link String } */ public void setSyndicationRight(String value) { this.syndicationRight = value; } /** * Gets the value of the adultContent property. * * @return possible object is {@link String } */ public String getAdultContent() { return adultContent; } /** * Sets the value of the adultContent property. * * @param value allowed object is {@link String } */ public void setAdultContent(String value) { this.adultContent = value; } /** * 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 {@link String } */ public List getLanguage() { if (language == null) { language = new ArrayList(); } return this.language; } /** * Add "Language". Contains a string that indicates that the search engine * supports search results in the specified language. * * @param language allowed object is {@link String } */ public void addLanguage(String language) { getLanguage().add(language); } /** * 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 {@link String } */ public List getOutputEncoding() { if (outputEncoding == null) { outputEncoding = new ArrayList(); } return this.outputEncoding; } /** * Adds OutputEncoding to the list of supported Output Encoding * * @param encoding allowed object is {@link String } */ public void addOutputEncoding(String encoding) { getOutputEncoding().add(encoding); } /** * 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 {@link String } */ public List getInputEncoding() { if (inputEncoding == null) { inputEncoding = new ArrayList(); } return this.inputEncoding; } /** * Adds InputEncoding to the list of supported Input Encoding * * @param encoding allowed object is {@link String } */ public void addInputEncoding(String encoding) { getInputEncoding().add(encoding); } /** * 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. * * @return always non-null */ public Map getOtherAttributes() { return otherAttributes; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy