org.joda.time.contrib.jsptag
Class DateTimeZoneSupport
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.joda.time.contrib.jsptag.DateTimeZoneSupport
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
- DateTimeZoneTag
public abstract class DateTimeZoneSupport
- extends javax.servlet.jsp.tagext.BodyTagSupport
Support for tag handlers for <timeZone>.
- Author:
- Jan Luehe, Jim Newsham
- See Also:
- Serialized Form
Field Summary |
private org.joda.time.DateTimeZone |
dateTimeZone
The zone. |
static java.lang.String |
FMT_TIME_ZONE
The config key for the time zone. |
protected java.lang.Object |
value
The value attribute. |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, 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 |
Method Summary |
int |
doEndTag()
|
int |
doStartTag()
|
org.joda.time.DateTimeZone |
getDateTimeZone()
|
(package private) static org.joda.time.DateTimeZone |
getDateTimeZone(javax.servlet.jsp.PageContext pc,
javax.servlet.jsp.tagext.Tag fromTag)
Determines and returns the time zone to be used by the given action. |
private void |
init()
|
void |
release()
|
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
FMT_TIME_ZONE
public static final java.lang.String FMT_TIME_ZONE
- The config key for the time zone.
- See Also:
- Constant Field Values
value
protected java.lang.Object value
- The value attribute.
dateTimeZone
private org.joda.time.DateTimeZone dateTimeZone
- The zone.
DateTimeZoneSupport
public DateTimeZoneSupport()
- Constructor.
init
private void init()
getDateTimeZone
public org.joda.time.DateTimeZone getDateTimeZone()
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Specified by:
doStartTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Specified by:
doEndTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
release
public void release()
- Specified by:
release
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
release
in class javax.servlet.jsp.tagext.BodyTagSupport
getDateTimeZone
static org.joda.time.DateTimeZone getDateTimeZone(javax.servlet.jsp.PageContext pc,
javax.servlet.jsp.tagext.Tag fromTag)
- Determines and returns the time zone to be used by the given action.
If the given action is nested inside a <dateTimeZone> action,
the time zone is taken from the enclosing <dateTimeZone> action.
Otherwise, the time zone configuration setting
org.joda.time.FMT_TIME_ZONE is used.
- Parameters:
pc
- the page containing the action for which the time zone
needs to be determinedfromTag
- the action for which the time zone needs to be determined
- Returns:
- the time zone, or null if the given action is not
nested inside a <dateTimeZone> action and no time zone configuration
setting exists