The Digester Component

Many projects read XML configuration files to provide initialization of various Java objects within the system. There are several ways of doing this, and the Digester component was designed to provide a common implementation that can be used in many different projects.

Basically, the Digester package lets you configure an XML -> Java object mapping module, which triggers certain actions called rules whenever a particular pattern of nested XML elements is recognized. A rich set of predefined rules is available for your use, or you can also create your own. Advanced features of Digester include:

  • Ability to plug in your own pattern matching engine, if the standard one is not sufficient for your requirements.
  • Optional namespace-aware processing, so that you can define rules that are relevant only to a particular XML namespace.
  • Encapsulation of Rules into RuleSets that can be easily and conveniently reused in more than one application that requires the same type of processing.

Documentation

User documentation is available as package descriptions within the JavaDoc API documents . In particular, you should read the package description for the org.apache.commons.digester package for detailed information on using the package.

The Release Notes document the new features and bug fixes that have been included in this release.

The "examples" directory in the source code repository contains code which demonstrates the basic functionality. In particular, you should read the AddressBook example in the "api" subdirectory. You can view the examples directly from the Subversion repository via the web-based repository browser web site, or can use subversion to download the files.

For the FAQ and other digester-related information, see the Digester wiki page .

Releases

Digester 2.0 Release (January 2009)

Digester 2.0 is a major release. New projects are encouraged to use this release of digester. There are breaking changes from Digester 1.8, see release notes in detail before choosing to upgrade. There is no urgency for existing projects to upgrade; Digester 1.8 has proven to be a stable release.

Digester 2.0 requires a minimum of JDK 1.5 and no longer requires any classes from Commons Collections (as Digester 1.8 did).

The recommended dependency set for Digester 2.0 is:

Recommended Dependency Set
Digester +Logging 1.1.1 +BeanUtils 1.8.0

It is also possible to use Logging 1.0.x or BeanUtils 1.7.0 instead.

Digester 1.8.1 Release (January 2009)

Digester 1.8.1 is a minor bugfix and maintenance release. Existing projects using Digester 1.8 are encouraged to upgrade to the 1.8.1 release. New projects are encouraged to use Digester 2.0, which requires JDK 1.5. See the release notes for more details.

The dependencies for Digester 1.8.1 are identical to the dependencies for Digester 1.8.

Digester 1.x versions had a dependency on Commons Collections . The dependency can alternatively be satisfied by including the latest BeanUtils releases (1.7.0 or above) (which include the stable collections ArrayStack class necessary).

The recommended dependency set for Digester 1.8.1 is:

Recommended Dependency Set
Digester +Logging 1.1.1 +BeanUtils 1.8.0

Other compatible dependency sets for Digester 1.8.1 can be summarized as follows:

Compatible Dependency Sets
Digester +Logging 1.1.x +BeanUtils 1.x +Collections 2.x
Digester +Logging 1.1.x +BeanUtils 1.x +Collections 3.x

It is also possible to use Logging 1.0.x or BeanUtils 1.7.0 instead.

Downloading

Please remember to verify the MD5 check sums.

Resources