public class PackageStringResourceLoader extends ComponentStringResourceLoader
The package based string resource loader attempts to find the resource from a bundle that corresponds to the supplied component objects package or one of its parent packages.
The search order for resources is component object package towards root package.
This implementation is fully aware of both locale and style values when trying to obtain the appropriate resources.
Looks for file called package.properties
Constructor and Description |
---|
PackageStringResourceLoader()
Create and initialize the resource loader.
|
Modifier and Type | Method and Description |
---|---|
String |
getFilename()
Gets the properties file filename (without extension)
|
String |
loadStringResource(Class<?> clazz,
String key,
Locale locale,
String style,
String variation)
Get the string resource for the given combination of component class, resource key, locale
and style.
|
void |
setFilename(String filename)
Sets the properties filename (without extension)
|
getPropertiesFactory, getResourcePath, isStopResourceSearch, isStopResourceSearch, loadStringResource, newResourceNameIterator
public PackageStringResourceLoader()
public String loadStringResource(Class<?> clazz, String key, Locale locale, String style, String variation)
IStringResourceLoader
loadStringResource
in interface IStringResourceLoader
loadStringResource
in class ComponentStringResourceLoader
clazz
- The class to get the string resource forkey
- The key should be a String containing a lookup key into a resource bundlelocale
- The locale should contain the locale of the current operation so that the
appropriate set of resources can be selectedstyle
- The style identifying the resource set to select the strings from (see
Session
)variation
- The components variation (of the style)public String getFilename()
public void setFilename(String filename)
filename
- filenameCopyright © 2006–2022 Apache Software Foundation. All rights reserved.