org.apache.commons.jelly.tags.fmt
Class SetLocaleTag
java.lang.Object
org.apache.commons.jelly.TagSupport
org.apache.commons.jelly.tags.fmt.SetLocaleTag
- All Implemented Interfaces:
- Tag
public class SetLocaleTag
- extends TagSupport
Support for tag handlers for <setLocale>, the locale setting
tag in JSTL.
- Version:
- 1.2
- Author:
- Willie Vu
Constructor Summary |
SetLocaleTag()
Creates a new instance of SetLocaleTag |
Method Summary |
void |
doTag(XMLOutput output)
Evaluates this tag after all the tags properties have been initialized. |
static java.util.Locale |
parseLocale(java.lang.String locale)
See parseLocale(String, String) for details. |
static java.util.Locale |
parseLocale(java.lang.String locale,
java.lang.String variant)
Parses the given locale string into its language and (optionally)
country components, and returns the corresponding
java.util.Locale object. |
void |
setScope(java.lang.String scope)
|
void |
setValue(Expression value)
|
void |
setVariant(Expression variant)
|
Methods inherited from class org.apache.commons.jelly.TagSupport |
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SetLocaleTag
public SetLocaleTag()
- Creates a new instance of SetLocaleTag
doTag
public void doTag(XMLOutput output)
throws JellyTagException
- Evaluates this tag after all the tags properties have been initialized.
- Throws:
JellyTagException
setValue
public void setValue(Expression value)
setVariant
public void setVariant(Expression variant)
setScope
public void setScope(java.lang.String scope)
parseLocale
public static java.util.Locale parseLocale(java.lang.String locale)
- See parseLocale(String, String) for details.
parseLocale
public static java.util.Locale parseLocale(java.lang.String locale,
java.lang.String variant)
- Parses the given locale string into its language and (optionally)
country components, and returns the corresponding
java.util.Locale object.
If the given locale string is null or empty, the runtime's default
locale is returned.
- Parameters:
locale
- the locale string to parsevariant
- the variant
- Returns:
- java.util.Locale object corresponding to the given
locale string, or the runtime's default locale if the locale string is
null or empty
- Throws:
java.lang.IllegalArgumentException
- if the given locale does not have a
language component or has an empty country component
Copyright © 2012. All Rights Reserved.