com.github.dandelion.datatables.core.html
Class HtmlTag

java.lang.Object
  extended by com.github.dandelion.datatables.core.html.HtmlTag
Direct Known Subclasses:
HtmlLink, HtmlRow, HtmlScript, HtmlTable, HtmlTagWithContent

public abstract class HtmlTag
extends Object

Abstract superclass for all HTML tags.

Author:
Thibault Duchateau

Field Summary
static char CLASS_SEPARATOR
           
protected  StringBuilder cssClass
          Plain old HTML class attribute.
protected  StringBuilder cssStyle
          Plain old HTML style attribute.
protected  Map<String,String> dynamicAttributes
          Dynamic native HTML attributes.
protected  String id
          Plain old HTML id attribute.
static char STYLE_SEPARATOR
           
protected  String tag
          Tag label.
 
Constructor Summary
HtmlTag()
           
 
Method Summary
 void addCssClass(String cssClass)
           
 void addCssStyle(String cssStyle)
           
 void addDynamicAttribute(String name, String value)
           
 StringBuilder getCssClass()
           
 StringBuilder getCssStyle()
           
 Map<String,String> getDynamicAttributes()
           
 String getDynamicAttributeValue(String attributeName)
           
protected  StringBuilder getDynamicHtmlAttributes()
           
protected  StringBuilder getHtmlAttributes()
           
protected  StringBuilder getHtmlClosingTag()
           
protected  StringBuilder getHtmlOpeningTag()
           
 String getId()
           
 String getTag()
           
 void removeDynamicAttribute(String attributeName)
           
 void setCssClass(StringBuilder cssClass)
           
 void setCssStyle(StringBuilder cssStyle)
           
 void setDynamicAttributes(Map<String,String> dynamicAttributes)
           
 void setId(String id)
           
 StringBuilder toHtml()
          Render the tag in HTML code.
protected static StringBuilder writeAttribute(String name, Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_SEPARATOR

public static final char CLASS_SEPARATOR
See Also:
Constant Field Values

STYLE_SEPARATOR

public static final char STYLE_SEPARATOR
See Also:
Constant Field Values

tag

protected String tag
Tag label.


id

protected String id
Plain old HTML id attribute.


cssClass

protected StringBuilder cssClass
Plain old HTML class attribute.


cssStyle

protected StringBuilder cssStyle
Plain old HTML style attribute.


dynamicAttributes

protected Map<String,String> dynamicAttributes
Dynamic native HTML attributes.

Constructor Detail

HtmlTag

public HtmlTag()
Method Detail

toHtml

public StringBuilder toHtml()
Render the tag in HTML code.

Returns:
the HTML code corresponding to the tag.

getHtmlOpeningTag

protected StringBuilder getHtmlOpeningTag()

getHtmlAttributes

protected StringBuilder getHtmlAttributes()

getDynamicHtmlAttributes

protected StringBuilder getDynamicHtmlAttributes()

writeAttribute

protected static StringBuilder writeAttribute(String name,
                                              Object data)

getHtmlClosingTag

protected StringBuilder getHtmlClosingTag()

getTag

public String getTag()

getId

public String getId()

setId

public void setId(String id)

getCssClass

public StringBuilder getCssClass()

setCssClass

public void setCssClass(StringBuilder cssClass)

getCssStyle

public StringBuilder getCssStyle()

setCssStyle

public void setCssStyle(StringBuilder cssStyle)

getDynamicAttributes

public Map<String,String> getDynamicAttributes()

getDynamicAttributeValue

public String getDynamicAttributeValue(String attributeName)

setDynamicAttributes

public void setDynamicAttributes(Map<String,String> dynamicAttributes)

addDynamicAttribute

public void addDynamicAttribute(String name,
                                String value)

removeDynamicAttribute

public void removeDynamicAttribute(String attributeName)

addCssClass

public void addCssClass(String cssClass)

addCssStyle

public void addCssStyle(String cssStyle)


Copyright © 2013–2014 Dandelion Project. All rights reserved.