org.salespointframework.web.helper
Class GenericHtmlTag

java.lang.Object
  extended by org.salespointframework.web.helper.GenericHtmlTag

public final class GenericHtmlTag
extends java.lang.Object

A HTML-Tag will be created with attributes.

Author:
Uwe Schmidt, Lars Kreisz

Constructor Summary
GenericHtmlTag(java.lang.String name)
          Initialize the tag.
 
Method Summary
 GenericHtmlTag attr(java.lang.String attributeName, java.lang.String attribute)
          method chaining version of @link setAttribute(String, String)
 void clearAttributes()
          Deletes all attributes.
 java.lang.String renderEnd()
          Render the end-tag.
 java.lang.String renderStart()
          Render a standard HTML-tag.
 java.lang.String renderStartAndClearAttributes()
          After rendering, all attributes are deleted.
 java.lang.String renderStartWithEnd()
          Render a XHTML-tag with '/>' at the end.
 java.lang.String renderStartWithEndAndClearAttributes()
          After rendering a XHTML-tag with '/>' at the end, all attributes are deleted.
 void setAttribute(java.lang.String attributeName, java.lang.String attribute)
          Takes an attribute into this tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericHtmlTag

public GenericHtmlTag(java.lang.String name)
Initialize the tag.

Parameters:
name - - By example a <div>-tag has the name 'div'.
Method Detail

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.String attribute)
Takes an attribute into this tag.

Parameters:
attributeName - - By example 'style'.
attribute - - By example 'width:50%;height:50%;...'.

attr

public GenericHtmlTag attr(java.lang.String attributeName,
                           java.lang.String attribute)
method chaining version of @link setAttribute(String, String)

Parameters:
attributeName - - By example 'style'.
attribute - - By example 'width:50%;height:50%;...'.

clearAttributes

public void clearAttributes()
Deletes all attributes.


renderStart

public java.lang.String renderStart()
Render a standard HTML-tag.

Returns:
String of the HTML-code.

renderStartWithEnd

public java.lang.String renderStartWithEnd()
Render a XHTML-tag with '/>' at the end.

Returns:
String of the HTML-code.

renderStartAndClearAttributes

public java.lang.String renderStartAndClearAttributes()
After rendering, all attributes are deleted.

Returns:
String of the HTML-code.

renderStartWithEndAndClearAttributes

public java.lang.String renderStartWithEndAndClearAttributes()
After rendering a XHTML-tag with '/>' at the end, all attributes are deleted.

Returns:
String of the HTML-code.

renderEnd

public java.lang.String renderEnd()
Render the end-tag.
By example: </div>.

Returns:
String of the HTML-code.