Class HtmlRender<T>

java.lang.Object
org.apache.juneau.html.HtmlRender<T>
Type Parameters:
T - The bean property type.

public abstract class HtmlRender<T> extends Object
Allows custom rendering of bean property values when serialized as HTML.

Associated with bean properties using the @Html(render) annotation.

Using this class, you can alter the CSS style and HTML content of the bean property.

See Also:
  • Constructor Details

  • Method Details

    • getStyle

      public String getStyle(SerializerSession session, T value)
      Returns the CSS style of the element containing the bean property value.
      Parameters:
      session - The current serializer session. Can be used to retrieve properties and session-level information.
      value - The bean property value.
      Returns:
      The CSS style string, or null if no style should be added.
    • getContent

      public Object getContent(SerializerSession session, T value)
      Returns the delegate value for the specified bean property value.

      The default implementation simply returns the same value. A typical use is to return an HTML element using one of the HTML5 DOM beans.

      Parameters:
      session - The current serializer session. Can be used to retrieve properties and session-level information.
      value - The bean property value.
      Returns:
      The new bean property value.