Interface HtmlElement

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default <T> T accept​(org.apache.sling.commons.html.util.Visitor<T> visitor)
      Accepts a Visitor to visit
      default boolean containsAttribute​(java.lang.String attrName)  
      java.util.Map<java.lang.String,​AttrValue> getAttributes()  
      default java.lang.String getAttributeValue​(java.lang.String name)  
      HtmlElementType getType()
      Retrieve the associated ElementType
      java.lang.String getValue()
      The String value that best represents what this element is.
      default boolean getVoidTag()
      Whether this element contains Attributes
      default boolean hasAttributes()  
      default void setAttribute​(java.lang.String name, java.lang.String value)  
      boolean supportsAttributes()
      Must be defined as true to allow default methods to work correctly, this method and the getAttributes method are used together to implement attribute support in an element.
    • Method Detail

      • getType

        HtmlElementType getType()
        Retrieve the associated ElementType
        Returns:
        element type
      • supportsAttributes

        boolean supportsAttributes()
        Must be defined as true to allow default methods to work correctly, this method and the getAttributes method are used together to implement attribute support in an element.
        Returns:
        true if Element supports attributes
      • getAttributes

        java.util.Map<java.lang.String,​AttrValue> getAttributes()
      • getValue

        java.lang.String getValue()
        The String value that best represents what this element is.
        Returns:
      • accept

        default <T> T accept​(org.apache.sling.commons.html.util.Visitor<T> visitor)
        Accepts a Visitor to visit
        Parameters:
        visitor -
        Returns:
      • getVoidTag

        default boolean getVoidTag()
        Whether this element contains Attributes
        Returns:
      • hasAttributes

        default boolean hasAttributes()
      • containsAttribute

        default boolean containsAttribute​(java.lang.String attrName)
      • getAttributeValue

        default java.lang.String getAttributeValue​(java.lang.String name)
      • setAttribute

        default void setAttribute​(java.lang.String name,
                                  java.lang.String value)