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 .setEntries(Entry... value) Bean property setter:entries .setGenerator(Generator value) Bean property setter:generator .Bean property setter:icon .Bean property setter:logo .setSubtitle(String value) Bean property fluent setter:subtitle .setSubtitle(Text value) Bean property setter:subtitle .Methods inherited from class org.apache.juneau.bean.atom.CommonEntry
getAuthors, getCategories, getContributors, getId, getLinks, getRights, getTitle, getUpdated, setAuthors, setBase, setCategories, setContributors, setId, setId, setLang, setLinks, setRights, setRights, setTitle, setTitle, setUpdated, setUpdated
-
Constructor Details
-
Feed
public Feed()Bean constructor. -
Feed
Normal constructor.- Parameters:
id- The feed identifier. Can benull to leave the property unset.title- The feed title. Can benull to leave the property unset.updated- The feed updated timestamp. Can benull to leave the property unset.
-
Feed
Normal constructor.- Parameters:
id- The feed identifier. Can benull , in which case the property is set to anIdwith no text (not left unset).title- The feed title. Can benull , in which case the property is set to aTextwith no text (not left unset).updated- The feed updated timestamp. Can benull or blank to leave the property unset.
-
-
Method Details
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-