org.apache.commons.resources.impl
Class WebappPropertyResourcesFactory
java.lang.Object
|
+--org.apache.commons.resources.impl.ResourcesFactoryBase
|
+--org.apache.commons.resources.impl.WebappResourcesFactoryBase
|
+--org.apache.commons.resources.impl.WebappPropertyResourcesFactory
- All Implemented Interfaces:
- ResourcesFactory, Serializable
- public class WebappPropertyResourcesFactory
- extends WebappResourcesFactoryBase
Concrete implementation of ResourcesFactory that creates
Resources instances that wrap a family (one per Locale) of
property files that share a base context-relative path for
servlet context resources, and have name suffixes reflecting
the Locale for which the file's messages apply. Resources are
looked up in a hierarchy of files in a manner identical to that
performed by java.util.ResourceBundle.getBundle().
The configuration variable passed to the createResources()
method must be the context-relative base name of the properties file family,
and must begin with a slash ('/') character.
For example, if the configuration URL is passed as
/WEB-INF/resources/MyResources, the resources for the
en_US Locale would be stored under context resource
/WEB-INF/resources/MyReesources_en_US.properties, and the
default resources would be stored in
/WEB-INF/resources/MyResources.properties.
- See Also:
- Serialized Form
|
Method Summary |
protected Resources |
createResources(String name,
String config)
Create and return a new Resources instance with the
specified logical name, after calling its init()
method and delegating the relevant properties. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebappPropertyResourcesFactory
public WebappPropertyResourcesFactory()
createResources
protected Resources createResources(String name,
String config)
Create and return a new Resources instance with the
specified logical name, after calling its init()
method and delegating the relevant properties.
- Specified by:
createResources in class ResourcesFactoryBase
- Parameters:
name - Logical name of the Resources instance to createconfig - Configuration string for this resource (if any)
- Returns:
- The new Resources instance.
- Throws:
ResourcesException - if a Resources instance
of the specified logical name cannot be created.
Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.