org.mmbase.bridge.jsp.taglib
Class TimeTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended by org.mmbase.bridge.jsp.taglib.TimeTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, Writer, WriterReferrer

public class TimeTag
extends ContextReferrerTag
implements Writer, WriterReferrer

The time taglib provides you easy functionality for using times in your web pages.

Since:
MMBase-1.6
Version:
$Id: TimeTag.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Rob Vermeulen (VPRO), Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
protected  Date _date
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
TimeTag()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 void doFinally()
           
 int doStartTag()
           
 Date getDate()
          You could implement a tag for the body of time-tag, which can then receive the date-object.
protected  SimpleDateFormat getDateFormat()
          DateFormat used for parsing dates.
protected  DateFormat getFormat()
           
protected static int getPrecisionConstant(String p)
           
 TimeZone getTimeZone()
          Get the timezone from the context or the timezone set in mmbase
 void setFormat(String f)
           
 void setInputformat(String inputformat)
           
 void setOffset(String offset)
           
 void setPrecision(String p)
           
 void setRelevance(String p)
           
 void setTime(String time)
           
 void setTimezone(String tz)
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
appendMoreParameters, doCatch, fillStandardParameters, findLoopOrQuery, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getCurrentBlock, getDefaultLocale, getEscapedValue, getFormTag, getId, getLocale, getLocaleFromContext, getObject, getObjectConditional, getPageContext, getPageContextTag, getQuery, getReferid, getString, getTaglibVersion, getThreadPageContext, getWriterValue, haveBody, release, setContext, setEscape, setId, setJspvar, setListdelimiter, setPageContext, setPageContextOnly, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.Writer
getWriterValue, haveBody, setEscape, setJspvar, setVartype, setWrite
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.WriterReferrer
findWriter, setWriter
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Field Detail

_date

protected Date _date
Since:
MMBase-1.7.1
Constructor Detail

TimeTag

public TimeTag()
Method Detail

setTime

public void setTime(String time)
             throws JspTagException
Throws:
JspTagException

setFormat

public void setFormat(String f)
               throws JspTagException
Throws:
JspTagException

setPrecision

public void setPrecision(String p)
                  throws JspTagException
Throws:
JspTagException

getPrecisionConstant

protected static int getPrecisionConstant(String p)
                                   throws JspTagException
Throws:
JspTagException

setRelevance

public void setRelevance(String p)
                  throws JspTagException
Throws:
JspTagException

getTimeZone

public TimeZone getTimeZone()
Description copied from class: ContextReferrerTag
Get the timezone from the context or the timezone set in mmbase

Overrides:
getTimeZone in class ContextReferrerTag
Returns:
timezone

getFormat

protected DateFormat getFormat()
                        throws JspTagException
Throws:
JspTagException

setInputformat

public void setInputformat(String inputformat)
                    throws JspTagException
Throws:
JspTagException

setOffset

public void setOffset(String offset)
               throws JspTagException
Throws:
JspTagException

setTimezone

public void setTimezone(String tz)
                 throws JspTagException
Throws:
JspTagException

getDate

public Date getDate()
You could implement a tag for the body of time-tag, which can then receive the date-object.

Since:
MMBase-1.7.1
To Do:
Don't we use getCalendar (to get Locales right)

doStartTag

public int doStartTag()
               throws JspTagException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspTagException

doAfterBody

public int doAfterBody()
                throws JspException
Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class BodyTagSupport
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspTagException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class ContextReferrerTag
Throws:
JspTagException

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class ContextReferrerTag

getDateFormat

protected SimpleDateFormat getDateFormat()
                                  throws JspTagException
DateFormat used for parsing dates.

Throws:
JspTagException


MMBase 2.0-SNAPSHOT - null