org.apache.commons.resources.impl
Class WebappXMLResourcesFactory
java.lang.Object
org.apache.commons.resources.impl.ResourcesFactoryBase
org.apache.commons.resources.impl.WebappResourcesFactoryBase
org.apache.commons.resources.impl.WebappXMLResourcesFactory
- All Implemented Interfaces:
- Serializable, ResourcesFactory
public class WebappXMLResourcesFactory
- extends WebappResourcesFactoryBase
Concrete implementation of ResourcesFactory
that creates
Resources
instances that wrap a family (one per Locale) of
XML documents that share a base context-relative path for
servlet context resources, and have name suffixes reflecting
the Locale for which the document's messages apply. Resources are
looked up in a hierarchy of documents 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 XML document 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.xml
, and the default
resources would be stored in
/WEB-INF/resources/MyResources.xml
.
- 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 |
WebappXMLResourcesFactory
public WebappXMLResourcesFactory()
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 © 2001-2010 The Apache Software Foundation. All Rights Reserved.