|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.dna.common.i18n.ClasspathLocalizationRepository
public class ClasspathLocalizationRepository
Implementation of a LocalizationRepository
that loads a properties file from the classpath of the supplied
class loader
.
This repository for a property file by building locations of the form "path/to/class_locale.properties", where "path/to/class" is created from the fully-qualified classname and all "." replaced with "/" characters, "locale" is the a variant of the locale (first the full locale, then subsequently with the last segment removed). As soon as a property file is found, its URL is returned immediately.
named with a name that matches
Constructor Summary | |
---|---|
ClasspathLocalizationRepository()
Create a repository using the current thread's context class loader or, if that is
null, the same class loader that loaded this class. |
|
ClasspathLocalizationRepository(java.lang.ClassLoader classLoader)
Create a repository using the supplied class loader. |
Method Summary | |
---|---|
java.net.URL |
getLocalizationBundle(java.lang.String bundleName,
java.util.Locale locale)
Obtain the URL to the properties file containing the localized messages given the supplied bundle name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClasspathLocalizationRepository()
context class loader
or, if that is
null, the same class loader that loaded this class.
public ClasspathLocalizationRepository(java.lang.ClassLoader classLoader)
context class loader
or, if that is null, the same class loader
that loaded this class.
classLoader
- the class loader to use; may be nullMethod Detail |
---|
public java.net.URL getLocalizationBundle(java.lang.String bundleName, java.util.Locale locale)
default locale
(as that is done by the calling
method.
getLocalizationBundle
in interface LocalizationRepository
bundleName
- the name of the bundle of properties; never nulllocale
- the locale for which the properties file URL is desired
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |