org.loom.tags.messages
Class FormatDurationTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by org.loom.tags.AbstractTag
          extended by org.loom.tags.messages.AbstractFormatTag
              extended by org.loom.tags.messages.FormatDurationTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag, LoomTag

@Tag(bodyContent=SCRIPTLESS,
     example="<l:formatDuration value=\"${myDurationInMillis}\"/>")
public class FormatDurationTag
extends AbstractFormatTag

Format a lapse of time in seconds/minutes/hours/days. Equivalent to DateHelper.distance_of_time_in_words in Ruby and Date.toDuration().humanized() in format.js


Field Summary
 
Fields inherited from class org.loom.tags.messages.AbstractFormatTag
repository
 
Fields inherited from class org.loom.tags.AbstractTag
expressionLanguageProxy, loomServletRequestFactory, out, request, response
 
Constructor Summary
FormatDurationTag()
           
 
Method Summary
 java.lang.String format()
           
 void setMaxUnits(int maxUnitsCount)
           
 void setValue(long value)
           
 
Methods inherited from class org.loom.tags.messages.AbstractFormatTag
doTagImpl, setRepository, setScope, setVar
 
Methods inherited from class org.loom.tags.AbstractTag
createWriterWrapper, doBody, doBufferedBody, doTag, endTag, evaluateExpression, getActionProperty, getAncestorWithClass, getBufferedBody, getExtendedAttributes, getMessagesRepository, getPageContext, getRequest, getResponse, getScopedAttribute, getWriter, initTag, printParentAttributes, removeScopedAttribute, setDynamicAttribute, setExtendedAttribute, setJspContext, setRequest, setResponse, setScopedAttribute, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatDurationTag

public FormatDurationTag()
Method Detail

format

public java.lang.String format()
Specified by:
format in class AbstractFormatTag

setValue

public void setValue(long value)

setMaxUnits

public void setMaxUnits(int maxUnitsCount)