org.loom.tags
Class TagAttributes

java.lang.Object
  extended by org.loom.tags.TagAttributes

public class TagAttributes
extends java.lang.Object

Extra attributes of a JSP tag. Any attribute that is not specifically handled by a JSP tag gets stored here. Attributes will be written in the same order they were added.


Constructor Summary
TagAttributes()
           
 
Method Summary
 void clear()
           
 java.lang.Object get(java.lang.String name)
          Retrieve an attribute.
 java.lang.String getPrefix()
           
 boolean isEmpty()
           
 void print(WriterWrapper<?> out)
          Write the list of attributes to the output.
 void remove(java.lang.String name)
           
 TagAttributes set(java.lang.String name, java.lang.Object value)
          Set an attribute if is value is != null
 void setPrefix(java.lang.String prefix)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TagAttributes

public TagAttributes()
Method Detail

set

public TagAttributes set(java.lang.String name,
                         java.lang.Object value)
Set an attribute if is value is != null

Parameters:
name - the name of the attribute, without prefix

print

public void print(WriterWrapper<?> out)
           throws java.io.IOException
Write the list of attributes to the output. Each attribute name get preceded with the prefix value, which is "data-" by default (the standard recommended by HTML 5). Other alternatives such as namespaced attributes are possible.

Throws:
java.io.IOException

get

public java.lang.Object get(java.lang.String name)
Retrieve an attribute.

Parameters:
name - the name of the attribute, without the applied prefix

remove

public void remove(java.lang.String name)

clear

public void clear()

getPrefix

public java.lang.String getPrefix()

setPrefix

public void setPrefix(java.lang.String prefix)

isEmpty

public boolean isEmpty()

size

public int size()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object