Class Ins<T extends Ins<T>>


public class Ins<T extends Ins<T>> extends PhrasingContentElement<T>
Represents an HTML <ins> (inserted text) element.

The <ins> element defines text that has been inserted into a document. It is typically used to mark additions in document revisions or to show content that has been added after initial publication. Browsers usually render inserted text with an underline, though this can be styled with CSS.

Features:

  • Marks inserted or added text content
  • Typically rendered with underline decoration
  • Useful for tracking document changes and revisions
  • Pairs semantically with the <del> element

Usage:


 // Mark inserted text
 Ins inserted = new Ins("This text was added");

 // Create empty ins element and add content later
 Ins ins = new Ins();
 ins.addText("New content");

 // Use with del to show changes
 P paragraph = new P();
 paragraph.addText("The price is ");
 paragraph.addElement(new Del("$50"));
 paragraph.addText(" ");
 paragraph.addElement(new Ins("$40"));
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Ins

      public Ins()
      Constructs an empty <ins> element.

      Creates an inserted text element without initial content. Text or other inline elements can be added later using inherited methods.

    • Ins

      public Ins(String text)
      Constructs an <ins> element with the specified text content.
      Parameters:
      text - the inserted text content; may be null or empty
  • Method Details

    • setCite

      public final T setCite(String url)
      Sets a URL to a document explaining why the text was inserted.

      If the URL starts with "/" (absolute path within the application), the servlet context path will be automatically prepended.

      Parameters:
      url - the citation URL
    • setDateTime

      public final T setDateTime(String dateTime)
      Sets the date and time when the text was inserted.
      Parameters:
      dateTime - the date/time in a valid datetime format