Package org.apache.sling.commons.html
Interface HtmlElement
-
@ProviderType public interface HtmlElement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Taccept(org.apache.sling.commons.html.util.Visitor<T> visitor)Accepts a Visitor to visitdefault booleancontainsAttribute(java.lang.String attrName)java.util.Map<java.lang.String,AttrValue>getAttributes()default java.lang.StringgetAttributeValue(java.lang.String name)HtmlElementTypegetType()Retrieve the associated ElementTypejava.lang.StringgetValue()The String value that best represents what this element is.default booleangetVoidTag()Whether this element contains Attributesdefault booleanhasAttributes()default voidsetAttribute(java.lang.String name, java.lang.String value)booleansupportsAttributes()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)
-
-