org.apache.commons.jelly.tags.fmt

## Class BundleTag

- java.lang.Object
- - org.apache.commons.jelly.TagSupport
  - - org.apache.commons.jelly.tags.fmt.BundleTag

All Implemented Interfaces:
  Tag

    public class BundleTag
    extends TagSupport

Support for tag handlers for <bundle>, the resource bundle loading tag in JSTL.

Version:
  1.1
Author:
  Willie Vu

### Field Summary

### Fields inherited from class org.apache.commons.jelly.TagSupport

`body, context, parent`

### Constructor Summary

Constructors
Constructor and Description
`BundleTag()`

### Method Summary

Methods
`void` `doTag(XMLOutput output)` Evaluates this tag after all the tags properties have been initialized.
`LocalizationContext` `getLocalizationContext()`
`static LocalizationContext` `getLocalizationContext(JellyContext jc)` Gets the default I18N localization context.
`static LocalizationContext` `getLocalizationContext(JellyContext jc, java.lang.String basename)` Gets the resource bundle with the given base name, whose locale is determined as follows: Check if a match exists between the ordered set of preferred locales and the available locales, for the given base name.
`java.lang.String` `getPrefixAsString()`
`void` `setBasename(Expression basename)` Setter for property basename.
`void` `setPrefix(Expression prefix)` Setter for property prefix.

### 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

#### BundleTag

    public BundleTag()

### Method Detail

#### getLocalizationContext

    public LocalizationContext getLocalizationContext()

#### getPrefixAsString

    public java.lang.String getPrefixAsString()

#### doTag

    public void doTag(XMLOutput output)
               throws JellyTagException

Evaluates this tag after all the tags properties have been initialized.

Throws:
  `JellyTagException`

#### getLocalizationContext

    public static LocalizationContext getLocalizationContext(JellyContext jc)

Gets the default I18N localization context.

Parameters:
  `jc` - Page in which to look up the default I18N localization context

#### getLocalizationContext

    public static LocalizationContext getLocalizationContext(JellyContext jc,
                                             java.lang.String basename)

Gets the resource bundle with the given base name, whose locale is determined as follows: Check if a match exists between the ordered set of preferred locales and the available locales, for the given base name. The set of preferred locales consists of a single locale (if the `org.apache.commons.jelly.tags.fmt.locale` configuration setting is present).

If no match was found in the previous step, check if a match exists between the fallback locale (given by the `org.apache.commons.jelly.tags.fmt.fallbackLocale` configuration setting) and the available locales, for the given base name.

Parameters:
  `pageContext` - Page in which the resource bundle with the given base name is requested
  `basename` - Resource bundle base name
Returns:
  Localization context containing the resource bundle with the given base name and the locale that led to the resource bundle match, or the empty localization context if no resource bundle match was found

#### setBasename

    public void setBasename(Expression basename)

Setter for property basename.

Parameters:
  `basename` - New value of property basename.

#### setPrefix

    public void setPrefix(Expression prefix)

Setter for property prefix.

Parameters:
  `prefix` - New value of property prefix.