org.modeshape.common.i18n
Class ClasspathLocalizationRepository
java.lang.Object
org.modeshape.common.i18n.ClasspathLocalizationRepository
public final class ClasspathLocalizationRepository
- extends Object
Class 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getLocalizationBundle
public static URL getLocalizationBundle(ClassLoader classLoader,
String bundleName,
Locale locale)
- Obtain the URL to the properties file containing the localized messages given the supplied bundle name. This method is
responsible for searching to find the most appropriate localized messages given the locale, but does not need to search
using the
default locale
(as that is done by the calling
method.
- Parameters:
classLoader
- the classloader that should be used to load the localization bundlesbundleName
- the name of the bundle of properties; never nulllocale
- the locale for which the properties file URL is desired
- Returns:
- the URL to the properties file containing the localized messages for the named bundle, or null if no such bundle
could be found
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.