org.apache.commons.resources.impl
Class XMLResourcesFactory

java.lang.Object
  extended by org.apache.commons.resources.impl.ResourcesFactoryBase
      extended by org.apache.commons.resources.impl.XMLResourcesFactory
All Implemented Interfaces:
Serializable, ResourcesFactory

public class XMLResourcesFactory
extends ResourcesFactoryBase

Concrete implementation of ResourcesFactory that creates Resources instances that wrap a family (one per Locale) of XML documents that share a base URL and have name suffices 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 URL of the base name of the XML document family. For example, if the configuration URL is passed as http://localhost/foo/Bar, the resources for the en_US Locale would be stored under URL http://localhost/foo/Bar_en_US.xml, and the default resources would be stored in http://localhost/foo/Bar.xml.

See Also:
Serialized Form

Constructor Summary
XMLResourcesFactory()
           
 
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 org.apache.commons.resources.impl.ResourcesFactoryBase
getResources, getResources, isReturnNull, release, setReturnNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLResourcesFactory

public XMLResourcesFactory()
Method Detail

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 create
config - 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.