Class Q


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

The q element represents a short inline quotation. It is used for short quotes that are part of the surrounding text, as opposed to blockquote which is used for longer, standalone quotations. The cite attribute can be used to provide a link to the source of the quotation.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple inline quotation Q q1 = q("To be or not to be, that is the question."); // Quotation with citation Q q2 = q("The only way to do great work is to love what you do.") .cite("https://example.com/source"); // Quotation in a paragraph P p1 = p( "As Shakespeare once said, ", q("All the world's a stage"), " and we are merely players." ); // Quotation with styling Q q3 = q("Innovation distinguishes between a leader and a follower.") .class_("highlighted-quote") .cite("https://example.com/author");

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

See Also:
  • Constructor Details

    • Q

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

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

    • cite

      public Q cite(String value)
      cite attribute.

      Specifies the URL of the source document or message from which the quotation was taken. This provides context and attribution for the quoted content.

      The URL should point to the original source of the quoted material.

      Parameters:
      value - The URL of the source document for the quotation. Can be null to unset the attribute.
      Returns:
      This object.