Class SvgElement<T extends SvgElement<T>>

Direct Known Subclasses:
SvgAnimate, SvgAnimateMotion, SvgAnimateTransform, SvgCircle, SvgContainerElement, SvgEllipse, SvgFeBlend, SvgFeColorMatrix, SvgFeComposite, SvgFeConvolveMatrix, SvgFeDisplacementMap, SvgFeDistantLight, SvgFeFlood, SvgFeFuncA, SvgFeFuncB, SvgFeFuncG, SvgFeFuncR, SvgFeGaussianBlur, SvgFeImage, SvgFeMergeNode, SvgFeMorphology, SvgFeOffset, SvgFePointLight, SvgFeSpotLight, SvgFeTile, SvgFeTurbulence, SvgImage, SvgLine, SvgPath, SvgPolygon, SvgPolyline, SvgRect, SvgSet, SvgStop, SvgUse

public abstract class SvgElement<T extends SvgElement<T>> extends StyledElement<T>
Abstract base class for all SVG elements.

Provides a common type for all SVG elements, ensuring that SVG container elements can restrict their children to SVG-only content. Both void (self-closing) and container SVG elements extend this class.

Since:
2026
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • SvgElement

      protected SvgElement(String tagName)
      Constructs an SVG container element with the specified tag name.

      The element renders with both an opening and closing tag, allowing child content.

      Parameters:
      tagName - the SVG tag name (e.g., "svg", "g", "defs")
    • SvgElement

      protected SvgElement(String tagName, boolean closed)
      Constructs an SVG element with the specified tag name and closing behavior.
      Parameters:
      tagName - the SVG tag name (e.g., "circle", "rect")
      closed - false for self-closing void elements, true for elements with closing tags