Class IconSerializer

java.lang.Object
io.jmix.aichat.util.IconSerializer

public final class IconSerializer extends Object
Serializes an icon Component to a static HTML string for client-side rendering, so a single action definition can be stamped into many message action bars without attaching per-message components.

Covers the four icon types the components document: Icon (the icon property), SvgIcon (src plus the symbol property), FontIcon (iconClass / fontFamily / char / ligature, all properties) and Image (src / alt attributes).

Temporary: a stopgap to be replaced once the framework provides its own icon serialization.

  • Method Details

    • serialize

      public static String serialize(com.vaadin.flow.component.Component icon)
      Serializes an icon component to the HTML string the client renders, writing element properties as dash-case attributes.
      Parameters:
      icon - the icon to serialize
      Returns:
      the icon's HTML representation