org.apache.commons.jelly.tags.fmt
Class SetLocaleTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.fmt.SetLocaleTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class SetLocaleTag
extends org.apache.commons.jelly.TagSupport

Support for tag handlers for <setLocale>, the locale setting tag in JSTL.

Version:
1.2
Author:
Willie Vu

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
SetLocaleTag()
          Creates a new instance of SetLocaleTag
 
Method Summary
 void doTag(org.apache.commons.jelly.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(org.apache.commons.jelly.expression.Expression value)
           
 void setVariant(org.apache.commons.jelly.expression.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
 

Constructor Detail

SetLocaleTag

public SetLocaleTag()
Creates a new instance of SetLocaleTag

Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException
Evaluates this tag after all the tags properties have been initialized.

Throws:
org.apache.commons.jelly.JellyTagException

setValue

public void setValue(org.apache.commons.jelly.expression.Expression value)

setVariant

public void setVariant(org.apache.commons.jelly.expression.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 parse
variant - 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 © 2002-2006 Apache Software Foundation. All Rights Reserved.