|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<java.lang.String,java.lang.String>
com.taggercat.tags.HTMLTagBuilder
public class HTMLTagBuilder
A simple class to help build HTML tags.
![]() |
![]() |
![]() |
![]() |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
HTMLTagBuilder(java.lang.String tagname)
Creates the HTML tag |
|
HTMLTagBuilder(java.lang.String tagname,
boolean xhtml)
Creates an HTML tag |
|
HTMLTagBuilder(java.lang.String tagname,
java.lang.String type)
Creates an HTML input type tag |
|
HTMLTagBuilder(java.lang.String tagname,
java.lang.String type,
boolean xhtml)
Creates an HTML input type tag |
|
| Method Summary | |
|---|---|
HTMLTagBuilder |
add(java.lang.String attributeName)
Adds an boolean type attribute; such as enabled, readonly etc. |
HTMLTagBuilder |
addAttribute(java.lang.String attributeName,
int value)
Adds an attribute and its value, only if it is greater than zero |
HTMLTagBuilder |
addAttribute(java.lang.String attributeName,
java.lang.String value)
Adds an attribute and its value; empty values are not added when not the value attributeName |
java.lang.StringBuilder |
getCloseHTMLTag()
Gets the tags corresponding closing tag, for tags such as textareas |
java.lang.String |
getHTMLBodyTag(java.lang.String bodyContent)
Get a complete body tag, such as that for a textarea, or option. |
java.lang.StringBuilder |
getHTMLTag()
Gets the HTML representation of the the tag |
java.lang.String |
put(java.lang.String key,
java.lang.String value)
|
void |
setChecked()
Sets the checked attribute |
void |
setChecked(boolean state)
Sets or clears the checked attribute |
void |
setDisabled()
Sets the disabled attribute |
void |
setDisabled(boolean state)
Sets or clears the disabled attribute |
void |
setReadOnly()
Sets the readonly attribute |
void |
setReadOnly(boolean state)
Sets or clears the readonly attribute |
void |
setSelected()
Sets or clears the selected attribute |
void |
setSelected(boolean state)
Sets or clears the selected attribute |
java.lang.String |
toString()
|
| Methods inherited from class java.util.LinkedHashMap |
|---|
clear, containsValue, get |
| Methods inherited from class java.util.HashMap |
|---|
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values |
| Constructor Detail |
|---|
public HTMLTagBuilder(java.lang.String tagname,
java.lang.String type,
boolean xhtml)
tagname - the tag nametype - the type of elementxhtml - set true to generate XHTML style tags
public HTMLTagBuilder(java.lang.String tagname,
java.lang.String type)
tagname - the tag nametype - the type of element
public HTMLTagBuilder(java.lang.String tagname,
boolean xhtml)
tagname - the tag namexhtml - set true to generate XHTML style tagspublic HTMLTagBuilder(java.lang.String tagname)
tagname - the name of the tag| Method Detail |
|---|
public HTMLTagBuilder add(java.lang.String attributeName)
attributeName - the attribute name to add
public HTMLTagBuilder addAttribute(java.lang.String attributeName,
java.lang.String value)
attributeName - the attribute name to addvalue - the value of the attribute name
public HTMLTagBuilder addAttribute(java.lang.String attributeName,
int value)
attributeName - the attribute name to addvalue - the value of the attribute name
public java.lang.StringBuilder getHTMLTag()
public java.lang.StringBuilder getCloseHTMLTag()
public void setChecked()
checked attribute
public void setDisabled()
disabled attribute
public void setReadOnly()
readonly attribute
public void setSelected()
selected attribute
public void setChecked(boolean state)
checked attribute
state - the new statepublic void setDisabled(boolean state)
disabled attribute
state - the new statepublic void setReadOnly(boolean state)
readonly attribute
state - the new statepublic void setSelected(boolean state)
selected attribute
state - the new statepublic java.lang.String getHTMLBodyTag(java.lang.String bodyContent)
bodyContent -
public java.lang.String toString()
toString in class java.util.AbstractMap<java.lang.String,java.lang.String>
public java.lang.String put(java.lang.String key,
java.lang.String value)
put in interface java.util.Map<java.lang.String,java.lang.String>put in class java.util.HashMap<java.lang.String,java.lang.String>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||