T - Class derived from HtmlElement@ConsumerType public class HtmlElement<T extends HtmlElement> extends AbstractHtmlElementFactory<T>
| Constructor and Description |
|---|
HtmlElement(String name)
Initializes html element.
|
| Modifier and Type | Method and Description |
|---|---|
<HtmlElementType extends HtmlElement> |
add(HtmlElementType element)
Appends the child to the end of the element's content list.
|
T |
addCssClass(String value)
Html "class" attribute.
|
String |
getCssClass()
Html "class" attribute.
|
String |
getData(String attributeName)
Custom Html5 "data-*" attribute.
|
protected boolean |
getEmptyAttributeValueAsBoolean(String attributeName)
Gets "empty" attribute value as boolean (i.e. for "checked" attribute).
|
String |
getId()
Html "id" attribute.
|
String |
getStyle(String styleAttribute)
Html "style" attribute.
|
Map<String,String> |
getStyles()
Html "style" attribute.
|
String |
getStyleString()
Html "style" attribute.
|
String |
getTitle()
Html "title" attribute.
|
T |
setCssClass(String value)
Sets Html "class" attribute - unless you're really sure that you want to replace existing classes,
you probably should call
addCssClass(String) instead. |
T |
setData(String attributeName,
String value)
Custom Html5 "data-*" attribute.
|
protected T |
setEmptyAttributeValueAsBoolean(String attributeName,
boolean value)
Sets "empty" attribute value as boolean (i.e. for "checked" attribute).
|
T |
setId(String value)
Html "id" attribute.
|
T |
setStyle(String styleAttribute,
String styleValue)
Html "style" attribute.
|
T |
setStyleString(String value)
Html "style" attribute.
|
T |
setTitle(String value)
Html "title" attribute.
|
create, createAnchor, createAnchor, createAnchor, createAudio, createComment, createDiv, createFigCaption, createFigure, createImage, createImage, createImage, createImage, createImage, createNoScript, createScript, createScript, createSource, createSpan, createSpan, createVideoadd, addContent, addContent, addContent, addContent, addContent, getAttributeValueAsInteger, getAttributeValueAsLong, setAttribute, setAttribute, setAttributeValueAsInteger, setAttributeValueAsLong, setName, setText, toString, toStringContentOnlyaddNamespaceDeclaration, canContainContent, clone, cloneContent, coalesceText, detach, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, getXMLBaseURI, hasAdditionalNamespaces, hasAttributes, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setNamespace, sortAttributes, sortChildren, sortContent, sortContentequals, getCType, getDocument, getParent, getParentElement, hashCode, setParentpublic HtmlElement(String name)
name - Element namepublic final <HtmlElementType extends HtmlElement> HtmlElementType add(HtmlElementType element)
HtmlElementType - Type that extends HtmlElementelement - Element to add. Null values are ignored.protected final boolean getEmptyAttributeValueAsBoolean(String attributeName)
attributeName - Attribute nameprotected final T setEmptyAttributeValueAsBoolean(String attributeName, boolean value)
attributeName - Attribute namevalue - Attribute value as booleanpublic final String getId()
public final T setId(String value)
value - Value of attributepublic final String getCssClass()
public final T setCssClass(String value)
addCssClass(String) instead.value - Value of attributepublic final T addCssClass(String value)
value - Value of attributepublic final String getStyleString()
public final Map<String,String> getStyles()
public final String getStyle(String styleAttribute)
styleAttribute - Style attribute namepublic final T setStyleString(String value)
value - Value of attribute with style key/value pairspublic final T setStyle(String styleAttribute, String styleValue)
styleAttribute - Style attribute namestyleValue - Style attribute valuepublic final String getTitle()
public final T setTitle(String value)
value - Value of attributepublic final String getData(String attributeName)
attributeName - Name of HTML5 data attribute (without the 'data-' prefix).Copyright © 2014–2017 wcm.io. All rights reserved.