Class Quotation<T extends Quotation<T>>


public class Quotation<T extends Quotation<T>> extends Q<T>
Represents an inline quotation element, providing a semantic alias for Q.

The Quotation class is a convenience wrapper that extends Q, providing a more descriptive class name for developers who prefer explicit naming. It represents short inline quotations and offers identical functionality to the Q class.

Features:

  • Identical functionality to Q
  • More descriptive class name
  • Semantic representation of inline quotations
  • Automatic quotation mark rendering by browsers
  • Source citation support via cite attribute
  • Inline element that doesn't break text flow

Usage:


 // Same as using Q, but with more explicit naming
 Paragraph text = new Paragraph();
 text.addText("The famous saying, ");
 Quotation quote = new Quotation("Knowledge is power");
 text.addElement(quote);
 text.addText(", is often attributed to Francis Bacon.");

 // With source citation
 Quotation cited = new Quotation("Innovation distinguishes between a leader and a follower.");
 cited.setCite("https://example.com/steve-jobs");

 // Empty quotation for later content
 Quotation placeholder = new Quotation();
 placeholder.addText("Quote added later");
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Q
  • invalid reference
    * @see Blockquote
  • Constructor Details

    • Quotation

      public Quotation()
      Constructs a new empty Quotation element.

      Creates an HTML <q> element with no initial content. Text can be added later using the inherited text methods. Browsers will automatically add quotation marks around the content.

    • Quotation

      public Quotation(String text)
      Constructs a new Quotation element with the specified quoted text.

      Creates an HTML <q> element containing the specified text. Browsers will automatically add appropriate quotation marks around the text.

      Parameters:
      text - the text to be quoted