public class

LocaleUtils

extends Object
java.lang.Object
   ↳ com.google.gwt.i18n.rebind.LocaleUtils

Class Overview

Utility methods for dealing with locales.

Summary

Public Methods
Set<GwtLocale> getAllCompileLocales()
Returns the set of all compile-time locales.
Set<GwtLocale> getAllLocales()
Returns the set of all available locales, whether compile-time locales or runtime locales.
GwtLocale getCompileLocale()
Returns the static compile-time locale for this permutation.
String getCookie()
Return the name of the cookie to potentially get the locale value from.
static LocaleUtils getInstance(TreeLogger logger, PropertyOracle propertyOracle, GeneratorContext context)
Create a new LocaleUtils instance for the given PropertyOracle.
static GwtLocaleFactory getLocaleFactory()
Get a shared GwtLocale factory so instances are cached between all uses.
String getQueryParam()
Return the name of the URL query param to potentially get the locale value from.
Set<GwtLocale> getRuntimeLocales()
Returns a list of locales which are children of the current compile-time locale.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Set<GwtLocale> getAllCompileLocales ()

Returns the set of all compile-time locales.

Returns
  • unmodifiable set of all compile-time locales

public Set<GwtLocale> getAllLocales ()

Returns the set of all available locales, whether compile-time locales or runtime locales.

Returns
  • unmodifiable set of all locales

public GwtLocale getCompileLocale ()

Returns the static compile-time locale for this permutation.

public String getCookie ()

Return the name of the cookie to potentially get the locale value from.

Returns
  • the cookie name or null if none

public static LocaleUtils getInstance (TreeLogger logger, PropertyOracle propertyOracle, GeneratorContext context)

Create a new LocaleUtils instance for the given PropertyOracle. Returned instances will be immutable and can be shared across threads.

Returns
  • LocaleUtils instance

public static GwtLocaleFactory getLocaleFactory ()

Get a shared GwtLocale factory so instances are cached between all uses.

Returns
  • singleton GwtLocaleFactory instance.

public String getQueryParam ()

Return the name of the URL query param to potentially get the locale value from.

Returns
  • the URL query param or null if none

public Set<GwtLocale> getRuntimeLocales ()

Returns a list of locales which are children of the current compile-time locale.

Returns
  • unmodifiable list of matching locales