FileDocCategorySizeDatePackage
LocalizationContext.javaAPI DocGlassfish v2 API4498Sat May 05 19:17:14 BST 2007javax.servlet.jsp.jstl.fmt

LocalizationContext

public class LocalizationContext extends Object
Class representing an I18N localization context.

An I18N localization context has two components: a resource bundle and the locale that led to the resource bundle match.

The resource bundle component is used by <fmt:message> for mapping message keys to localized messages, and the locale component is used by the <fmt:message>, <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, and <fmt:parseDate> actions as their formatting or parsing locale, respectively.

author
Jan Luehe

Fields Summary
private final ResourceBundle
bundle
private final Locale
locale
Constructors Summary
public LocalizationContext()
Constructs an empty I18N localization context.

	bundle = null;
	locale = null;
    
public LocalizationContext(ResourceBundle bundle, Locale locale)
Constructs an I18N localization context from the given resource bundle and locale.

The specified locale is the application- or browser-based preferred locale that led to the resource bundle match.

param
bundle The localization context's resource bundle
param
locale The localization context's locale

	this.bundle = bundle;
	this.locale = locale;
    
public LocalizationContext(ResourceBundle bundle)
Constructs an I18N localization context from the given resource bundle.

The localization context's locale is taken from the given resource bundle.

param
bundle The resource bundle

	this.bundle = bundle;
	this.locale = bundle.getLocale();
    
Methods Summary
public java.util.LocalegetLocale()
Gets the locale of this I18N localization context.

return
The locale of this I18N localization context, or null if this I18N localization context is empty, or its resource bundle is a (locale-less) root resource bundle.

	return locale;
    
public java.util.ResourceBundlegetResourceBundle()
Gets the resource bundle of this I18N localization context.

return
The resource bundle of this I18N localization context, or null if this I18N localization context is empty

	return bundle;