org.mmbase.bridge.jsp.taglib
Class LocaleTag

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.CloudReferrerTag
                  extended by org.mmbase.bridge.jsp.taglib.LocaleTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
ContentTag

public class LocaleTag
extends CloudReferrerTag

Provides Locale (language, country) information to its body.

Version:
$Id: LocaleTag.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
protected  Cloud cloud
           
static String KEY
           
protected  Locale locale
           
protected  Locale prevCloudLocale
           
protected  Locale prevJstlLocale
           
static int SCOPE
           
static String TZ_KEY
           
protected  Set<String> varyHeaders
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
cloudId
 
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
LocaleTag()
           
 
Method Summary
protected  void addVary(String header)
           
protected  void determineFromCloudProvider()
           
protected  void determineLocale()
           
protected  void determineLocaleFromAttributes()
           
 int doAfterBody()
           
 int doEndTag()
           
 void doFinally()
           
 int doStartTag()
           
 Locale getLocale()
          Child tags can call this function to obtain the Locale they must use.
 void setCountry(String c)
           
 void setJspvar(String j)
           
 void setLanguage(String lang)
           
 void setTimezone(String t)
           
 void setVariant(String v)
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
fillStandardParameters, findCloudProvider, findCloudProvider, getCloudContext, getCloudVar, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
appendMoreParameters, doCatch, findLoopOrQuery, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getCurrentBlock, getDefaultLocale, getEscapedValue, getFormTag, getId, getLocaleFromContext, getObject, getObjectConditional, getPageContext, getPageContextTag, getQuery, getReferid, getString, getTaglibVersion, getThreadPageContext, getTimeZone, getWriterValue, haveBody, release, setContext, setEscape, setId, 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 javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Field Detail

KEY

public static final String KEY
See Also:
Constant Field Values

TZ_KEY

public static final String TZ_KEY
See Also:
Constant Field Values

SCOPE

public static final int SCOPE
See Also:
Constant Field Values

locale

protected Locale locale

prevCloudLocale

protected Locale prevCloudLocale

prevJstlLocale

protected Locale prevJstlLocale

cloud

protected Cloud cloud

varyHeaders

protected Set<String> varyHeaders
Constructor Detail

LocaleTag

public LocaleTag()
Method Detail

setLanguage

public void setLanguage(String lang)
                 throws JspTagException
Throws:
JspTagException

setCountry

public void setCountry(String c)
                throws JspTagException
Throws:
JspTagException

setVariant

public void setVariant(String v)
                throws JspTagException
Throws:
JspTagException

setTimezone

public void setTimezone(String t)
                 throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8.1

getLocale

public Locale getLocale()
Child tags can call this function to obtain the Locale they must use.

Overrides:
getLocale in class CloudReferrerTag
Returns:
a locale when defined or otherwise the mmbase locale.

setJspvar

public void setJspvar(String j)
Overrides:
setJspvar in class ContextReferrerTag

doStartTag

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

determineLocale

protected void determineLocale()
                        throws JspTagException
Throws:
JspTagException

determineFromCloudProvider

protected void determineFromCloudProvider()
                                   throws JspTagException
Throws:
JspTagException

addVary

protected void addVary(String header)

determineLocaleFromAttributes

protected void determineLocaleFromAttributes()
                                      throws JspTagException
Throws:
JspTagException

doAfterBody

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

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


MMBase 2.0-SNAPSHOT - null