Package org.deltava.taglib.format
Class QuantityFormatTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.format.UserSettingsTag
org.deltava.taglib.format.NumberFormatTag
org.deltava.taglib.format.IntegerFormatTag
org.deltava.taglib.format.QuantityFormatTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
A JSP Tag to display quantities of a particular item.
- Since:
- 1.0
- Version:
- 10.3
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.taglib.format.NumberFormatTag
_nF, _value, _zeroValue
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 number and quantity and writes them to the JSP output writer.int
Updates the plural tag to the singular tag if not set.void
release()
Resets this tag's data when its lifecycle is complete.void
Updates the label used for plural values.void
Updates the label used for a single value.Methods inherited from class org.deltava.taglib.format.IntegerFormatTag
fmtNoDecimals, setValue
Methods inherited from class org.deltava.taglib.format.NumberFormatTag
closeSpan, getClassNameBuilder, openSpan, printValue, release, setClassName, setFmt, setForceSign, setPageContext, setValue, setZero
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Constructor Details
-
QuantityFormatTag
public QuantityFormatTag()
-
-
Method Details
-
setSingle
Updates the label used for a single value.- Parameters:
label
- the single value label
-
setPlural
Updates the label used for plural values. If none is specified, the label used for single values will be used.- Parameters:
label
- the plural value label
-
doStartTag
Updates the plural tag to the singular tag if not set.- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classNumberFormatTag
- Returns:
- SKIP_BODY always
- Throws:
JspException
- never
-
release
public void release()Description copied from class:IntegerFormatTag
Resets this tag's data when its lifecycle is complete.- Specified by:
release
in interfaceTag
- Overrides:
release
in classIntegerFormatTag
-
doEndTag
Formats the number and quantity and writes them to the JSP output writer. If the value cannot be parsed, it is output "as is".- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classIntegerFormatTag
- Returns:
- TagSupport.EVAL_PAGE
- Throws:
JspException
- if an error occurs
-