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

com.sun.syndication.feed.synd.SyndFeed Maven / Gradle / Ivy

There is a newer version: 3.1.0-incubating
Show newest version
/*
 * Copyright 2004 Sun Microsystems, Inc.
 *
 * Licensed 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.
 *
 */
package com.sun.syndication.feed.synd;

import com.sun.syndication.feed.CopyFrom;
import com.sun.syndication.feed.WireFeed;
import com.sun.syndication.feed.module.Extendable;
import com.sun.syndication.feed.module.Module;

import java.util.Date;
import java.util.List;

/**
 * Bean interface for all types of feeds.
 * 

* It handles all RSS versions and Atom 0.3, it normalizes all info, it may lose information. *

* @author Alejandro Abdelnur * */ public interface SyndFeed extends Cloneable, CopyFrom, Extendable { /** * Returns the real feed types the SyndFeedImpl supports when converting from and to. *

* @return the real feed type supported. */ List getSupportedFeedTypes(); /** * Creates a real feed containing the information of the SyndFeedImpl. *

* The feed type of the created WireFeed is taken from the SyndFeedImpl feedType property. *

* @return the real feed. * */ WireFeed createWireFeed(); /** * Creates a real feed containing the information of the SyndFeedImpl. *

* @param feedType the feed type for the WireFeed to be created. * @return the real feed. * */ WireFeed createWireFeed(String feedType); /** * Returns the WireFeed this SyndFeed was created from. * Will return null if the original feed is not stored or if this SyndFeed was not created from a WireFeed * * @return The WireFeed this was created from, or null * */ WireFeed originalWireFeed(); /** * * @return true if this SyndFeed preserves the WireFeed it was created from */ boolean isPreservingWireFeed(); /** * Returns the wire feed type the feed had/will-have when converted from/to a WireFeed. *

* @return the feed type, null if none. * */ String getFeedType(); /** * Sets the wire feed type the feed will-have when coverted to a WireFeed. *

* @param feedType the feed type to set, null if none. * */ void setFeedType(String feedType); /** * Returns the charset encoding of a the feed. This is not set by Rome parsers. *

* @return the charset encoding of the feed. * */ public String getEncoding(); /** * Sets the charset encoding of a the feed. This is not set by Rome parsers. *

* @param encoding the charset encoding of the feed. * */ public void setEncoding(String encoding); /** * Returns the feed URI. *

* How the feed URI maps to a concrete feed type (RSS or Atom) depends on * the concrete feed type. This is explained in detail in Rome documentation, * Feed and entry URI mapping. *

* The returned URI is a normalized URI as specified in RFC 2396bis. *

* Note: The URI is the unique identifier, in the RSS 2.0/atom case this is * the GUID, for RSS 1.0 this is the URI attribute of the item. The Link * is the URL that the item is accessible under, the URI is the * permanent identifier which the aggregator should use to reference * this item. Often the URI will use some standardized identifier scheme * such as DOI's so that items can be identified even if they appear in * multiple feeds with different "links" (they might be on different * hosting platforms but be the same item). Also, though rare, there * could be multiple items with the same link but a different URI and * associated metadata which need to be treated as distinct entities. * In the RSS 1.0 case the URI must be a valid RDF URI reference. *

* @return the feed URI, null if none. * */ String getUri(); /** * Sets the feed URI. *

* How the feed URI maps to a concrete feed type (RSS or Atom) depends on * the concrete feed type. This is explained in detail in Rome documentation, * Feed and entry URI mapping. *

* Note: The URI is the unique identifier, in the RSS 2.0/atom case this is * the GUID, for RSS 1.0 this is the URI attribute of the item. The Link * is the URL that the item is accessible under, the URI is the * permanent identifier which the aggregator should use to reference * this item. Often the URI will use some standardized identifier scheme * such as DOI's so that items can be identified even if they appear in * multiple feeds with different "links" (they might be on different * hosting platforms but be the same item). Also, though rare, there * could be multiple items with the same link but a different URI and * associated metadata which need to be treated as distinct entities. * In the RSS 1.0 case the URI must be a valid RDF URI reference. *

* @param uri the feed URI to set, null if none. * */ void setUri(String uri); /** * Returns the feed title. *

* @return the feed title, null if none. * */ String getTitle(); /** * Sets the feed title. *

* @param title the feed title to set, null if none. * */ void setTitle(String title); /** * Returns the feed title. *

* @return the feed title, null if none. * */ SyndContent getTitleEx(); /** * Sets the feed title. *

* @param title the feed title to set, null if none. * */ void setTitleEx(SyndContent title); /** * Returns the feed link. *

* Note: The URI is the unique identifier, in the RSS 2.0/atom case this is * the GUID, for RSS 1.0 this is the URI attribute of the item. The Link * is the URL that the item is accessible under, the URI is the * permanent identifier which the aggregator should use to reference * this item. Often the URI will use some standardized identifier scheme * such as DOI's so that items can be identified even if they appear in * multiple feeds with different "links" (they might be on different * hosting platforms but be the same item). Also, though rare, there * could be multiple items with the same link but a different URI and * associated metadata which need to be treated as distinct entities. * In the RSS 1.0 case the URI must be a valid RDF URI reference. *

* @return the feed link, null if none. * */ String getLink(); /** * Sets the feed link. *

* Note: The URI is the unique identifier, in the RSS 2.0/atom case this is * the GUID, for RSS 1.0 this is the URI attribute of the item. The Link * is the URL that the item is accessible under, the URI is the * permanent identifier which the aggregator should use to reference * this item. Often the URI will use some standardized identifier scheme * such as DOI's so that items can be identified even if they appear in * multiple feeds with different "links" (they might be on different * hosting platforms but be the same item). Also, though rare, there * could be multiple items with the same link but a different URI and * associated metadata which need to be treated as distinct entities. * In the RSS 1.0 case the URI must be a valid RDF URI reference. *

* @param link the feed link to set, null if none. * */ void setLink(String link); /** * Returns the entry links *

* @return the entry links, null if none. * */ List getLinks(); /** * Sets the entry links. *

* @param links the entry links to set, null if none. * */ void setLinks(List links); /** * Returns the feed description. *

* @return the feed description, null if none. * */ String getDescription(); /** * Sets the feed description. *

* @param description the feed description to set, null if none. * */ void setDescription(String description); /** * Returns the feed description as a text construct. *

* @return the feed description, null if none. * */ SyndContent getDescriptionEx(); /** * Sets the feed description as a text construct. *

* @param description the feed description to set, null if none. * */ void setDescriptionEx(SyndContent description); /** * Returns the feed published date. *

* This method is a convenience method, it maps to the Dublin Core module date. *

* @return the feed published date, null if none. * */ Date getPublishedDate(); /** * Sets the feed published date. *

* This method is a convenience method, it maps to the Dublin Core module date. *

* @param publishedDate the feed published date to set, null if none. * */ void setPublishedDate(Date publishedDate); /** * Returns the feed authors. *

* For Atom feeds, this returns the authors as a list of SyndPerson objects, * for RSS feeds this method is a convenience method, it maps to the * Dublin Core module creator. *

* @return the feed authors, null if none. * */ List getAuthors(); /** * Sets the feed authors. *

* For Atom feeds, this sets the authors as a list of SyndPerson * objects, for RSS feeds this method is a convenience method, it maps * to the Dublin Core module creator. *

* @param authors the feed authors to set, null if none. * */ void setAuthors(List authors); /** * Returns the name of the first feed author in the collection of authors. *

* For Atom feeds, this returns the authors as a list of SyndPerson objects, * for RSS feeds this method is a convenience method, it maps to the * Dublin Core module creator. *

* @return the feed author, null if none. * */ String getAuthor(); /** * Sets the feed author. *

* For Atom feeds, this sets the feed author's name, for RSS feeds * this method is a convenience method, it maps to the Dublin Core * module creator. *

* @param author the feed author to set, null if none. * */ void setAuthor(String author); /** * Returns the feed author. *

* For Atom feeds, this returns the contributors as a list of * SyndPerson objects *

* @return the feed author, null if none. * */ public List getContributors(); /** * Sets the feed author. *

* Returns contributors as a list of SyndPerson objects. *

* @param contributors the feed contributors to set, null if none. * */ void setContributors(List contributors); /** * Returns the feed copyright. *

* This method is a convenience method, it maps to the Dublin Core module rights. *

* @return the feed copyright, null if none. * */ String getCopyright(); /** * Sets the feed copyright. *

* This method is a convenience method, it maps to the Dublin Core module rights. *

* @param copyright the feed copyright to set, null if none. * */ void setCopyright(String copyright); /** * Returns the feed image. *

* @return the feed image, null if none. * */ SyndImage getImage(); /** * Sets the feed image. *

* @param image the feed image to set, null if none. * */ void setImage(SyndImage image); /** * Returns the feed categories. *

* This method is a convenience method, it maps to the Dublin Core module subjects. *

* @return a list of SyndCategoryImpl elements with the feed categories, * an empty list if none. * */ List getCategories(); /** * Sets the feed categories. *

* This method is a convenience method, it maps to the Dublin Core module subjects. *

* @param categories the list of SyndCategoryImpl elements with the feed categories to set, * an empty list or null if none. * */ void setCategories(List categories); /** * Returns the feed entries. *

* @return a list of SyndEntry elements with the feed entries, * an empty list if none. * */ List getEntries(); /** * Sets the feed entries. *

* @param entries the list of SyndEntryImpl elements with the feed entries to set, * an empty list or null if none. * */ void setEntries(List entries); /** * Returns the feed language. *

* This method is a convenience method, it maps to the Dublin Core module language. *

* @return the feed language, null if none. * */ String getLanguage(); /** * Sets the feed language. *

* This method is a convenience method, it maps to the Dublin Core module language. *

* @param language the feed language to set, null if none. * */ void setLanguage(String language); /** * Returns the module identified by a given URI. *

* @param uri the URI of the ModuleImpl. * @return The module with the given URI, null if none. */ public Module getModule(String uri); /** * Returns the feed modules. *

* @return a list of ModuleImpl elements with the feed modules, * an empty list if none. * */ List getModules(); /** * Sets the feed modules. *

* @param modules the list of ModuleImpl elements with the feed modules to set, * an empty list or null if none. * */ void setModules(List modules); /** * Returns foreign markup found at channel level. *

* @return Opaque object to discourage use * */ public Object getForeignMarkup(); /** * Sets foreign markup found at channel level. *

* @param foreignMarkup Opaque object to discourage use * */ public void setForeignMarkup(Object foreignMarkup); /** * Creates a deep clone of the object. *

* @return a clone of the object. * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned. * */ public Object clone() throws CloneNotSupportedException; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy