Package org.deltava.taglib.format
Class DurationFormatTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.format.UserSettingsTag
org.deltava.taglib.format.DurationFormatTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
A JSP tag to support the display of formatted date/time values.
- Since:
- 7.0
- Version:
- 10.1
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.taglib.format.UserSettingsTag
_user
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
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
-
Method Summary
Modifier and TypeMethodDescriptionint
doEndTag()
Formats the date/time and writes it to the JSP output writer.void
release()
void
setClassName
(String cName) Updates the CSS class for this formatted date/time.void
setDefault
(String defaultText) Updates the text to display if the date is null.void
Sets the duration to display.void
setLong
(boolean isLong) Updates whether to use a text format description.final void
setPageContext
(PageContext ctxt) Sets the tag's JSP context and loads the user data.void
Updates the time format pattern.Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Constructor Details
-
DurationFormatTag
public DurationFormatTag()
-
-
Method Details
-
setPageContext
Description copied from class:UserSettingsTag
Sets the tag's JSP context and loads the user data.- Specified by:
setPageContext
in interfaceTag
- Overrides:
setPageContext
in classUserSettingsTag
- Parameters:
ctxt
- the JSP context
-
setClassName
Updates the CSS class for this formatted date/time. This will automatically enclose the output in a <SPAN> tag.- Parameters:
cName
- the class Name(s)
-
setDefault
Updates the text to display if the date is null.- Parameters:
defaultText
- the text to display
-
setLong
public void setLong(boolean isLong) Updates whether to use a text format description.- Parameters:
isLong
- TRUE if text description should be used, otherwise FALSE
-
setT
Updates the time format pattern.- Parameters:
pattern
- the pattern string- Throws:
IllegalArgumentException
- ifDateTimeFormatter
cannot interpret the pattern
-
setDuration
-
release
public void release()- Specified by:
release
in interfaceTag
- Overrides:
release
in classTagSupport
-
doEndTag
Formats the date/time and writes it to the JSP output writer.- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Returns:
- TagSupport.EVAL_PAGE
- Throws:
JspException
- if an error occurs
-