Class Article


@Marshalled(typeName="article") public class Article extends HtmlElementMixed<Article>
DTO for an HTML <article> element.

The article element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable. It is used for content that could stand alone, such as blog posts, news articles, forum posts, or other independent pieces of content. Each article should have its own heading structure and can contain other semantic elements.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple blog post article Article blogPost = article( header( h1("How to Use HTML5 Semantic Elements"), p("Published on ", time("2024-01-15", "January 15, 2024")) ), p("HTML5 introduced several semantic elements that help structure content..."), footer( p("Author: John Doe"), address("Contact: john@example.com") ) ); // News article Article newsArticle = article( header( h1("Breaking: New Technology Released"), p("By Jane Smith, Technology Reporter") ), p("A revolutionary new technology was announced today..."), section( h2("Technical Details"), p("The technology works by...") ) ); // Forum post Article forumPost = article( header( h3("Question about CSS Grid"), p("Posted by ", strong("user123"), " on ", time("2024-01-14", "yesterday")) ), p("I'm having trouble with CSS Grid layout..."), footer( p("Tags: ", a("/tag/css", "CSS"), ", ", a("/tag/grid", "Grid")) ) ).class_("forum-post"); // Product review Article review = article( header( h1("Review: Amazing Widget Pro"), p("Rating: ", strong("5/5 stars")) ), p("After using the Amazing Widget Pro for a month..."), section( h2("Pros"), ul( li("Easy to use"), li("Great performance"), li("Excellent support") ) ) ); // Article with multiple sections Article multiSection = article( header(h1("Complete Guide to Web Development")), section( h2("Introduction"), p("Web development encompasses many technologies...") ), section( h2("Frontend Development"), p("Frontend development focuses on...") ), section( h2("Backend Development"), p("Backend development handles...") ) );

The following convenience methods are provided for constructing instances of this bean:

See Also:
  • Constructor Details

    • Article

      public Article()
      Creates an empty Article element.
    • Article

      public Article(Object... children)
      Creates an Article element with the specified child nodes.
      Parameters:
      children - The child nodes. Must not be null.
  • Method Details

    • footer

      public Article footer(Object... children)
      Adds a footer node to this element.
      Parameters:
      children - The children inside the footer node. Must not be null.
      Returns:
      This object.
    • header

      public Article header(Object... children)
      Adds a header node to this element.
      Parameters:
      children - The children inside the header node. Must not be null.
      Returns:
      This object.
    • link

      public Article link(Link value)
      Adds a link node to this element.
      Parameters:
      value - The link node to add to this article. Can be null (a null entry is added to the children list).
      Returns:
      This object.
    • section

      public Article section(Section value)
      Adds a section node to this element.
      Parameters:
      value - The section node to add to this article. Can be null (a null entry is added to the children list).
      Returns:
      This object.