Package org.deltava.taglib.format
Class UnitFormatTag
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.UnitFormatTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
- Direct Known Subclasses:
DistanceFormatTag
,WeightFormatTag
A JSP tag to convert and format unit values.
- Since:
- 5.2
- 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 writes it to the JSP output writer.void
release()
Resets this tag's data when its lifecycle is complete.void
setLongUnits
(boolean useLong) Sets whether to use long or short unit names.abstract void
Overrides the units to display the value in.Methods inherited from class org.deltava.taglib.format.IntegerFormatTag
fmtNoDecimals, setValue
Methods inherited from class org.deltava.taglib.format.NumberFormatTag
closeSpan, doStartTag, 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
-
Field Details
-
_unit
-
-
Constructor Details
-
UnitFormatTag
public UnitFormatTag()
-
-
Method Details
-
setUnits
Overrides the units to display the value in.- Parameters:
units
- the unit abbreviation
-
setLongUnits
public void setLongUnits(boolean useLong) Sets whether to use long or short unit names.- Parameters:
useLong
- TRUE if long unit names are used, otherwise FALSE
-
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 writes it to the JSP output writer.- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classIntegerFormatTag
- Returns:
- TagSupport.EVAL_PAGE always
- Throws:
JspException
- if an error occurs
-