Resources : Resource bundle component

Many Java applications must support internationalization (i18n) of message strings presented as part of the user interface, or in messages written to log files. The standard Java APIs offer the java.util.ResourceBundle family of classes to support this requirement; however, these classes have the following limitations that reduce their usefulness:

  • The classes assume that all messages should be presented based on a single Locale, while many applications require support for different Locales for each current application user.
  • The ResourceBundle implementation classes do not implement the java.io.Serializable interface, which is required in some operational environments.

The classes in the Resources package offer solutions to these two problems, and provide a framework for providing customized Resources implementations that can access resource strings from any desired static or dynamically updated collection.

Resources API

The core of the resources framework are two interfaces:

  • Resources Representation of a set of internationalized resources, which are arbitrary objects identified by a unique String key and can be accessed for different java.util.Locale.
  • ResourcesFactory Factory class to configure and instantiate an appropriate Resources instance.

Basic implementations of the above are provided for resources contained in property files, XML and databases(via JDBC). Implementations are also provided for use in a Web App environment.

The resources framework also includes interfaces for encapsualting messages and message lists:

  • Message An encapsulation of an individual message, consisting of a message key, and replacement values.
  • MessageList A class that encapsulates a set of messages.

Documentation

Wiki

See the Commons Wiki for the User Guide, class diagram and other resources:

JavaDoc

The JavaDoc API documents are available here.

The following versions of the JavaDoc API documents are available online:

Source Code Repository

The subversion repository can be browsed.

Releases

See the Downloads page for current/previous releases.

Release Notes are available here.

Support

The commons mailing lists act as the main support forum. The user list is suitable for most library usage queries. The dev list is intended for the development discussion. Please remember that the lists are shared between all commons components, so prefix your email by [resources].

Issues may be reported via ASF Bugzilla. Please remember that Bugzilla is shared between all commons components, so prefix your issue by [resources].