Class Feed
An Atom feed is a Web resource that contains metadata and optionally a set of entries. Feeds are the top-level container element in Atom documents and act as a manifest of metadata and data associated with a collection of related resources.
The feed is the fundamental unit of syndication in Atom and is used to aggregate entries that share a common purpose, such as a blog, podcast channel, or news source.
Schema
atomFeed = element atom:feed { atomCommonAttributes, (atomAuthor* & atomCategory* & atomContributor* & atomGenerator? & atomIcon? & atomId & atomLink* & atomLogo? & atomRights? & atomSubtitle? & atomTitle & atomUpdated & extensionElement*), atomEntry* }
Required Elements:
Per RFC 4287, the following elements are required in a feed:
atom:id - A permanent, universally unique identifier for the feed.atom:title - A human-readable title for the feed.atom:updated - The most recent instant in time when the feed was modified.
Recommended Elements:
The following elements are recommended but not required:
atom:author - Authors of the feed (required if entries don't have authors).atom:link - Links associated with the feed (should include a "self" link).
Example:
Specification:
Represents an
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEntry[]
Bean property getter:entries .Bean property getter:generator .getIcon()
Bean property getter:icon .getLogo()
Bean property getter:logo .Bean property getter:subtitle .setAuthors
(Person... value) Bean property setter:authors .Bean property setter:base .setCategories
(Category... value) Bean property setter:categories .setContributors
(Person... value) Bean property setter:contributors .setEntries
(Entry... value) Bean property setter:entries .setGenerator
(Generator value) Bean property setter:generator .Bean property setter:icon .Bean property fluent setter:id .Bean property setter:id .Bean property setter:lang .Bean property setter:links .Bean property setter:logo .Bean property fluent setter:rights .Bean property setter:rights .setSubtitle
(String value) Bean property fluent setter:subtitle .setSubtitle
(Text value) Bean property setter:subtitle .Bean property fluent setter:title .Bean property setter:title .setUpdated
(String value) Bean property fluent setter:updated .setUpdated
(Calendar value) Bean property setter:updated .Methods inherited from class org.apache.juneau.bean.atom.CommonEntry
getAuthors, getCategories, getContributors, getId, getLinks, getRights, getTitle, getUpdated
-
Constructor Details
-
Feed
Normal constructor.- Parameters:
id
- The feed identifier.title
- The feed title.updated
- The feed updated timestamp.
-
Feed
Normal constructor.- Parameters:
id
- The feed identifier.title
- The feed title.updated
- The feed updated timestamp.
-
Feed
public Feed()Bean constructor.
-
-
Method Details
-
getGenerator
Bean property getter:generator .Identifies the software agent used to generate the feed.
This is useful for debugging and analytics purposes, allowing consumers to identify the software responsible for producing the feed.
- Returns:
- The property value, or
null if it is not set.
-
setGenerator
Bean property setter:generator .Identifies the software agent used to generate the feed.
Example:
Feed
feed =new Feed(...) .setGenerator(new Generator("My Blog Software" ) .setUri("http://www.example.com/software" ) .setVersion("2.0" ) );- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
getIcon
Bean property getter:icon .Identifies a small image that provides iconic visual identification for the feed.
Icons should be square and small (typically 16x16 or similar). The image should have an aspect ratio of 1 (horizontal) to 1 (vertical).
- Returns:
- The property value, or
null if it is not set.
-
setIcon
Bean property setter:icon .Identifies a small image that provides iconic visual identification for the feed.
Example:
Feed
feed =new Feed(...) .setIcon(new Icon("http://example.org/icon.png" ));- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
getLogo
Bean property getter:logo .Identifies a larger image that provides visual identification for the feed.
Logos should be twice as wide as they are tall (aspect ratio of 2:1).
- Returns:
- The property value, or
null if it is not set.
-
setLogo
Bean property setter:logo .Identifies a larger image that provides visual identification for the feed.
Example:
Feed
feed =new Feed(...) .setLogo(new Logo("http://example.org/logo.png" ));- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
getSubtitle
Bean property getter:subtitle .Returns a human-readable description or subtitle for the feed.
The subtitle provides additional context about the feed's purpose or content beyond what is conveyed in the title.
- Returns:
- The property value, or
null if it is not set.
-
setSubtitle
Bean property setter:subtitle .Sets a human-readable description or subtitle for the feed.
Example:
Feed
feed =new Feed(...) .setSubtitle(new Text("html" ) .setText("A <em>comprehensive</em> guide to Atom feeds" ) );- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setSubtitle
Bean property fluent setter:subtitle .Sets a human-readable description or subtitle for the feed as plain text.
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
getEntries
Bean property getter:entries .Returns the individual entries contained within this feed.
Each entry represents a single item in the feed, such as a blog post, news article, podcast episode, or other discrete piece of content. Entries contain their own metadata including title, content, links, and timestamps.
- Returns:
- The property value, or
null if it is not set.
-
setEntries
Bean property setter:entries .Sets the individual entries contained within this feed.
Example:
Feed
feed =new Feed(...) .setEntries(new Entry("tag:example.org,2024:entry1" ,"First Post" ,"2024-01-15T12:00:00Z" ) .setContent(new Content("html" ) .setText("<p>This is the content</p>" ) ),new Entry("tag:example.org,2024:entry2" ,"Second Post" ,"2024-01-16T12:00:00Z" ) );- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setBase
Description copied from class:Common
Bean property setter:base .Sets the base URI for resolving relative URI references (xml:base attribute).
The value can be of any of the following types:
URI
,URL
,String
. Strings must be valid URIs.Example:
Feed
feed =new Feed(...) .setBase("http://example.org/" );- Overrides:
setBase
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setLang
Description copied from class:Common
Bean property setter:lang .Sets the natural language of the element's content (xml:lang attribute).
Example:
Text
title =new Text("text" ) .setText("Mon Blog" ) .setLang("fr" );- Overrides:
setLang
in classCommonEntry
- Parameters:
value
- The new value for this property (e.g., "en", "fr", "de", "en-US").
Can benull to unset the property.- Returns:
- This object.
-
setAuthors
Description copied from class:CommonEntry
Bean property setter:authors .The list of authors for this object.
- Overrides:
setAuthors
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setCategories
Description copied from class:CommonEntry
Bean property setter:categories .The list of categories of this object.
- Overrides:
setCategories
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setContributors
Description copied from class:CommonEntry
Bean property setter:contributors .The list of contributors of this object.
- Overrides:
setContributors
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setId
Description copied from class:CommonEntry
Bean property fluent setter:id .The ID of this object.
- Overrides:
setId
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setId
Description copied from class:CommonEntry
Bean property setter:id .The ID of this object.
- Overrides:
setId
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setLinks
Description copied from class:CommonEntry
Bean property setter:links .The list of links of this object.
- Overrides:
setLinks
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setRights
Description copied from class:CommonEntry
Bean property fluent setter:rights .The rights statement of this object.
- Overrides:
setRights
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setRights
Description copied from class:CommonEntry
Bean property setter:rights .The rights statement of this object.
- Overrides:
setRights
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setTitle
Description copied from class:CommonEntry
Bean property fluent setter:title .The title of this object.
- Overrides:
setTitle
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setTitle
Description copied from class:CommonEntry
Bean property setter:title .The title of this object.
- Overrides:
setTitle
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setUpdated
Description copied from class:CommonEntry
Bean property fluent setter:updated .The update timestamp of this object.
- Overrides:
setUpdated
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setUpdated
Description copied from class:CommonEntry
Bean property setter:updated .The update timestamp of this object.
- Overrides:
setUpdated
in classCommonEntry
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-