Commons BeanUtils

Most Java developers are used to creating Java classes that conform to the JavaBeans naming patterns for property getters and setters. It is natural to then access these methods directly, using calls to the corresponding getXxx and setXxx methods. However, there are some occasions where dynamic access to Java object properties (without compiled-in knowledge of the property getter and setter methods to be called) is needed. Example use cases include:

  • Building scripting languages that interact with the Java object model (such as the Bean Scripting Framework).
  • Building template language processors for web presentation and similar uses (such as JSP or Velocity).
  • Building custom tag libraries for JSP and XSP environments (such as Jakarta Taglibs, Struts, Cocoon).
  • Consuming XML-based configuration resources (such as Ant build scripts, web application deployment descriptors, Tomcat's server.xml file).

The Java language provides Reflection and Introspection APIs (see the java.lang.reflect and java.beans packages in the JDK Javadocs). However, these APIs can be quite complex to understand and utilize. The BeanUtils component provides easy-to-use wrappers around these capabilities.

BeanUtils Core And Modules

The next release will see a departure from the usual packaging strategy. Rather than just a single jar, BeanUtils will distribute a commons-beanutils-core.jar containing the essential parts of BeanUtils with minimal dependencies (for this release just Commons Logging). Other parts of BeanUtils (typically specialized modules) will be distributed as separate, modular jars with additional dependencies. Hopefully this will allow library and framework creators more finely grained control over their dependencies. It should also help with compatibility issues.

For everyone else, don't worry :) There will be a single commons-beanutils-all.jar containing everything. Drop it in and add any dependencies your application needs.

Bean Collections

Bean collections is a library combining BeanUtils with Commons Collections to provide services for collections of beans. Once class (BeanComparator) was previously released, the rest are new. This new distribution strategy should allow this sub-component to evolve naturally without the concerns about size and scope that might otherwise happen.

Bean Collections has an additional dependency on Commons Collections.

Documentation

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

The JavaDoc API documents are available online. In particular, you should note the property reference syntax options described in the PropertyUtils class description.

Releases

Mirrored Releases

Releases after 1.5 should be downloaded from a mirror. Please remember to verify the sigature of the release from the main apache site when downloading from a mirror.

Binary releases are available here. Source releases are available here

1.7.x Releases (Mirrored)

BeanUtils 1.7.0 is a service release which removes the dependency upon a specific commons-collection library version. It may be safely used together with either the 2.x or 3.x series of commons-collections releases. It also introduces a number of important enhancements. It is backward compatible with the 1.6 release.

1.6.x Releases (Mirrored)

  • Version 1.6.1 (latest) - 18 Feb 2003
  • Version 1.6 - 21 Jan 2003

Older Releases (Not Mirrored)