Class Strike<T extends Strike<T>>


public class Strike<T extends Strike<T>> extends S<T>
Represents an HTML <s> element, providing a semantic alias for strikethrough text.

This class extends the S class and provides an alternative, more descriptive name for creating strikethrough text elements. The Strike class renders text with a horizontal line through it, typically used to indicate deleted or irrelevant content.

Features:

  • Provides a descriptive alias for the <s> HTML element
  • Supports text initialization through constructor
  • Inherits all styling and behavior from the S parent class
  • Commonly used to represent deleted or no-longer-accurate content

Usage:


 // Create an empty strikethrough element
 Strike strike = new Strike();

 // Create strikethrough text
 Strike oldPrice = new Strike("$99.99");

 // Combine with other elements
 Span pricing = new Span();
 pricing.addElement(new Strike("$99.99"));
 pricing.addElement(new Text(" "));
 pricing.addElement(new Strong("$79.99"));
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • S
  • invalid reference
    PhrasingContentElement
  • Constructor Details

    • Strike

      public Strike()
      Constructs an empty Strike element.

      Creates a new <s> element with no initial text content. Text can be added later using methods inherited from the parent class.

    • Strike

      public Strike(String text)
      Constructs a Strike element with the specified text content.

      Creates a new <s> element containing the provided text, which will be rendered with a horizontal line through it.

      Parameters:
      text - the text content to display with strikethrough formatting