Class Entry


@Bean(typeName="entry") public class Entry extends CommonEntry
Represents an individual entry within an Atom feed or as a standalone Atom document.

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 or atom:link[@rel="alternate"] - Either content or alternate link.
  • atom:summary - Brief summary of the entry (required if content is not inline).
Example:

// Create an entry Entry entry = new Entry( "tag:example.org,2024:entry1", "My First Blog Post", "2024-01-15T12:00:00Z" ) .setAuthors( new Person("Jane Doe") .setEmail("jane@example.org") ) .setContent( new Content("html") .setText("<p>This is my first blog post!</p>") ) .setSummary("An introduction to my new blog") .setPublished("2024-01-15T10:00:00Z") .setLinks( new Link("alternate", "text/html", "http://example.org/posts/1") );

Specification:

Represents an atomEntry construct in the RFC 4287 - Section 4.1.2 specification.

See Also:
  • Constructor Details

    • Entry

      public Entry(Id id, Text title, Calendar updated)
      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(String id, String title, String updated)
      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

      public Content 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

      public Entry setContent(Content value)
      Bean property setter: content.

      Sets the content of this entry.

      Examples:

      // Plain text content Entry entry = new Entry(...) .setContent( new Content("text") .setText("This is plain text content") ); // HTML content Entry entry2 = new Entry(...) .setContent( new Content("html") .setText("<p>This is <strong>HTML</strong> content</p>") ); // Link to external content Entry entry3 = new Entry(...) .setContent( new Content() .setType("video/mp4") .setSrc("http://example.org/video.mp4") );

      Parameters:
      value - The new value for this property.
      Can be null 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

      public Entry setPublished(Calendar value)
      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 be null to unset the property.
      Returns:
      This object.
    • setPublished

      public Entry setPublished(String value)
      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 be null to unset the property.
      Returns:
      This object.
    • getSource

      public Source 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

      public Entry setSource(Source value)
      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 be null to unset the property.
      Returns:
      This object.
    • getSummary

      public Text 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

      public Entry setSummary(Text value)
      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 be null to unset the property.
      Returns:
      This object.
    • setSummary

      public Entry setSummary(String value)
      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 be null to unset the property.
      Returns:
      This object.
    • setBase

      public Entry setBase(Object value)
      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 class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setLang

      public Entry setLang(String value)
      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 class CommonEntry
      Parameters:
      value - The new value for this property (e.g., "en", "fr", "de", "en-US").
      Can be null to unset the property.
      Returns:
      This object.
    • setAuthors

      public Entry setAuthors(Person... value)
      Description copied from class: CommonEntry
      Bean property setter: authors.

      The list of authors for this object.

      Overrides:
      setAuthors in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setCategories

      public Entry setCategories(Category... value)
      Description copied from class: CommonEntry
      Bean property setter: categories.

      The list of categories of this object.

      Overrides:
      setCategories in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setContributors

      public Entry setContributors(Person... value)
      Description copied from class: CommonEntry
      Bean property setter: contributors.

      The list of contributors of this object.

      Overrides:
      setContributors in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setId

      public Entry setId(String value)
      Description copied from class: CommonEntry
      Bean property fluent setter: id.

      The ID of this object.

      Overrides:
      setId in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setId

      public Entry setId(Id value)
      Description copied from class: CommonEntry
      Bean property setter: id.

      The ID of this object.

      Overrides:
      setId in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setLinks

      public Entry setLinks(Link... value)
      Description copied from class: CommonEntry
      Bean property setter: links.

      The list of links of this object.

      Overrides:
      setLinks in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setRights

      public Entry setRights(String value)
      Description copied from class: CommonEntry
      Bean property fluent setter: rights.

      The rights statement of this object.

      Overrides:
      setRights in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setRights

      public Entry setRights(Text value)
      Description copied from class: CommonEntry
      Bean property setter: rights.

      The rights statement of this object.

      Overrides:
      setRights in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setTitle

      public Entry setTitle(String value)
      Description copied from class: CommonEntry
      Bean property fluent setter: title.

      The title of this object.

      Overrides:
      setTitle in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setTitle

      public Entry setTitle(Text value)
      Description copied from class: CommonEntry
      Bean property setter: title.

      The title of this object.

      Overrides:
      setTitle in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setUpdated

      public Entry setUpdated(String value)
      Description copied from class: CommonEntry
      Bean property fluent setter: updated.

      The update timestamp of this object.

      Overrides:
      setUpdated in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setUpdated

      public Entry setUpdated(Calendar value)
      Description copied from class: CommonEntry
      Bean property setter: updated.

      The update timestamp of this object.

      Overrides:
      setUpdated in class CommonEntry
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object