public class LocalizedResourceHelper
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
DEFAULT_SEPARATOR
The default separator to use inbetween file name parts: an underscore
|
| 构造器和说明 |
|---|
LocalizedResourceHelper()
Create a new LocalizedResourceHelper with a DefaultResourceLoader.
|
LocalizedResourceHelper(org.frameworkset.util.io.ResourceLoader resourceLoader)
Create a new LocalizedResourceHelper with the given ResourceLoader.
|
| 限定符和类型 | 方法和说明 |
|---|---|
org.frameworkset.util.io.Resource |
findLocalizedResource(java.lang.String name,
java.lang.String extension,
java.util.Locale locale)
Find the most specific localized resource for the given name,
extension and locale:
The file will be searched with locations in the following order,
similar to
java.util.ResourceBundle's search order:
[name]_[language]_[country]_[variant][extension]
[name]_[language]_[country][extension]
[name]_[language][extension]
[name][extension]
If none of the specific files can be found, a resource
descriptor for the default location will be returned. |
void |
setSeparator(java.lang.String separator)
Set the separator to use inbetween file name parts.
|
public static final java.lang.String DEFAULT_SEPARATOR
public LocalizedResourceHelper()
DefaultResourceLoaderpublic LocalizedResourceHelper(org.frameworkset.util.io.ResourceLoader resourceLoader)
resourceLoader - the ResourceLoader to usepublic void setSeparator(java.lang.String separator)
public org.frameworkset.util.io.Resource findLocalizedResource(java.lang.String name,
java.lang.String extension,
java.util.Locale locale)
The file will be searched with locations in the following order,
similar to java.util.ResourceBundle's search order:
If none of the specific files can be found, a resource descriptor for the default location will be returned.
name - the name of the file, without localization part nor extensionextension - the file extension (e.g. ".xls")locale - the current locale (may be null)ResourceBundle