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 .setAuthors
(Person... value) Bean property setter:authors .Bean property setter:base .setCategories
(Category... value) Bean property setter:categories .setContent
(Content value) Bean property setter:content .setContributors
(Person... value) Bean property setter:contributors .Bean property fluent setter:id .Bean property setter:id .Bean property setter:lang .Bean property setter:links .setPublished
(String value) Bean property fluent setter:published .setPublished
(Calendar value) Bean property setter:published .Bean property fluent setter:rights .Bean property setter:rights .Bean property setter:source .setSummary
(String value) Bean property fluent setter:summary .setSummary
(Text value) Bean property setter:summary .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
-
Entry
Normal constructor.- Parameters:
id
- The ID of this entry.title
- The title of this entry.updated
- The updated timestamp of this entry.
-
Entry
Normal constructor.- Parameters:
id
- The ID of this entry.title
- The title of this entry.updated
- The updated timestamp of this entry.
-
Entry
public Entry()Bean constructor.
-
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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
-