Class Entry
An Atom entry is a discrete item of content within a feed, such as a blog post, news article, podcast episode, or other individual piece of content. Entries can exist within a feed or be published as standalone Atom documents.
Each entry contains metadata about the content (title, authors, timestamps) and optionally the content itself or links to it. Entries are designed to be independently meaningful and may be consumed separately from their containing feed.
Schema
atomEntry = element atom:entry { atomCommonAttributes, (atomAuthor* & atomCategory* & atomContent? & atomContributor* & atomId & atomLink* & atomPublished? & atomRights? & atomSource? & atomSummary? & atomTitle & atomUpdated & extensionElement*) }
Required Elements:
Per RFC 4287, the following elements are required in an entry:
atom:id - A permanent, universally unique identifier for the entry.atom:title - A human-readable title for the entry.atom:updated - The most recent instant in time when the entry was modified.
Recommended Elements:
The following elements are recommended:
atom:author - Authors of the entry (required if feed doesn't have authors).atom:content oratom:link[@rel="alternate"] - Either content or alternate link.atom:summary - Brief summary of the entry (required if content is not inline).
Example:
Specification:
Represents an
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBean property getter:content .Bean property getter:published .Bean property getter:source .Bean property getter:summary .setContent(Content value) Bean property setter:content .setPublished(String value) Bean property fluent setter:published .setPublished(Calendar value) Bean property setter:published .Bean property setter:source .setSummary(String value) Bean property fluent setter:summary .setSummary(Text value) Bean property setter:summary .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
-
Entry
public Entry()Bean constructor. -
Entry
Normal constructor.- Parameters:
id- The ID of this entry. Can benull to leave the property unset.title- The title of this entry. Can benull to leave the property unset.updated- The updated timestamp of this entry. Can benull to leave the property unset.
-
Entry
Normal constructor.- Parameters:
id- The ID of this entry. Can benull , in which case the property is set to anIdwith no text (not left unset).title- The title of this entry. Can benull , in which case the property is set to aTextwith no text (not left unset).updated- The updated timestamp of this entry. Can benull or blank to leave the property unset.
-
-
Method Details
-
getContent
Bean property getter:content .Returns the content of this entry, or a link to it.
The content element contains or links to the complete content of the entry. It can contain text, HTML, XHTML, or other media types. When not present, the entry must have an alternate link pointing to the content.
- Returns:
- The property value, or
null if it is not set.
-
getPublished
Bean property getter:published .Returns the time when this entry was first published or made available.
This differs from the updated time in that it represents the original publication date, which typically doesn't change even when the entry is modified. The updated timestamp reflects the last modification time.
- Returns:
- The property value, or
null if it is not set.
-
getSource
Bean property getter:source .Returns metadata about the source feed if this entry was copied from another feed.
When an entry is copied or aggregated from another feed, the source element preserves metadata from the original feed. This is useful for attribution and tracking the origin of syndicated content.
- Returns:
- The property value, or
null if it is not set.
-
getSummary
Bean property getter:summary .Returns a short summary, abstract, or excerpt of the entry.
The summary is typically used in feed readers to give users a preview of the entry's content without loading the full content. It's especially useful when content is not inline or is very long.
- Returns:
- The property value, or
null if it is not set.
-
setContent
Bean property setter:content .Sets the content of this entry.
Examples:
// Plain text content Entryentry =new Entry(...) .setContent(new Content("text" ) .setText("This is plain text content" ) );// HTML content Entryentry2 =new Entry(...) .setContent(new Content("html" ) .setText("<p>This is <strong>HTML</strong> content</p>" ) );// Link to external content Entryentry3 =new Entry(...) .setContent(new Content() .setType("video/mp4" ) .setSrc("http://example.org/video.mp4" ) );- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setPublished
Bean property setter:published .Sets the time when this entry was first published or made available.
Example:
Entry
entry =new Entry(...) .setPublished(Calendar.getInstance ());- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setPublished
Bean property fluent setter:published .Sets the time when this entry was first published using an ISO-8601 date string.
Example:
Entry
entry =new Entry(...) .setPublished("2024-01-15T10:00:00Z" );- Parameters:
value- The new value for this property in ISO-8601 format.
Can benull to unset the property.- Returns:
- This object.
-
setSource
Bean property setter:source .Sets metadata about the source feed if this entry was copied from another feed.
Example:
Entry
entry =new Entry(...) .setSource(new Source() .setId("tag:originalblog.example.com,2024:feed" ) .setTitle("Original Blog" ) .setUpdated("2024-01-15T12:00:00Z" ) );- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setSummary
Bean property fluent setter:summary .Sets a short summary, abstract, or excerpt of the entry as plain text.
- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
setSummary
Bean property setter:summary .Sets a short summary, abstract, or excerpt of the entry.
Example:
Entry
entry =new Entry(...) .setSummary(new Text("text" ) .setText("This entry discusses the benefits of Atom feeds..." ) );- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-