public class LocaleUtility extends Object implements GlobalPropertyListener
| Constructor and Description |
|---|
LocaleUtility() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areCompatible(Locale lhs,
Locale rhs)
Compatible is a looser matching than that provided by Locale.equals().
|
static Locale |
fromSpecification(String localeSpecification)
Creates a locale based on a string specification.
|
static Locale |
getDefaultLocale()
Gets the default locale specified as a global property.
|
static Set<Locale> |
getLocalesInOrder()
Utility method that returns a collection of all openmrs system locales, the set includes the
current logged in user's preferred locale if any is set, the default locale, allowed locales
in the order they are specified in the 'allowed.locale.list' global property and 'en' at the
very end of the set if it isn't yet among them.
|
void |
globalPropertyChanged(GlobalProperty newValue)
Called after a global property is created or updated
|
void |
globalPropertyDeleted(String propertyName)
Called after a global property is deleted
|
static boolean |
isValid(Locale locale)
Checks if specified locale object is valid
|
static void |
setDefaultLocaleCache(Locale defaultLocaleCache) |
static void |
setLocalesAllowedListCache(List<Locale> localesAllowedListCache) |
boolean |
supportsPropertyName(String propertyName)
Asks this listener whether it wants to be notified about the given property name
|
public static Locale getDefaultLocale()
public static boolean areCompatible(Locale lhs, Locale rhs)
lhs - left hand side Localerhs - right hand side Localepublic static Locale fromSpecification(String localeSpecification)
localeSpecification - encoded locale specificationpublic static Set<Locale> getLocalesInOrder()
public static void setDefaultLocaleCache(Locale defaultLocaleCache)
public static void setLocalesAllowedListCache(List<Locale> localesAllowedListCache)
public void globalPropertyChanged(GlobalProperty newValue)
GlobalPropertyListenerglobalPropertyChanged in interface GlobalPropertyListenernewValue - the new value of the property that was just savedpublic void globalPropertyDeleted(String propertyName)
GlobalPropertyListenerglobalPropertyDeleted in interface GlobalPropertyListenerpropertyName - the name of the property that was just deletedpublic boolean supportsPropertyName(String propertyName)
GlobalPropertyListenersupportsPropertyName in interface GlobalPropertyListenerpublic static boolean isValid(Locale locale)
locale - object for validationCopyright © 2024 OpenMRS Inc.. All rights reserved.