Joda-Beans provides a small framework that adds properties to Java, greatly enhancing JavaBeans.

The key concept is to allow each property on a bean to be accessed as an object in its own right. This provides the hook for other technologies to build on, such as serialization, mapping, expression languages and validation.

Joda-Beans is licensed under the business-friendly Apache 2.0 licence.


A selection of key features:

  • Code generate mutable and immutable beans
  • No more manually written getters, setters, equals, hashCode, toString or immutable builders
  • High quality generated code, perfect for use in an API or for creating Javadoc
  • Full-featured property abstraction, treating a bean as a map of properties
  • Fast, no use of reflection
  • Built in JSON, XML and binary serialization


Various documentation is available:

Why Joda Beans?

Joda-Beans has been created to plug a gap in the Java language - properties. The concept of properties is familiar to those coding in almost every other modern language. Java stands alone in its pursuit of the JavaBeans, a specification built on naming conventions and reflection.

JavaBeans are typically created by manual coding or one-off IDE generation, such as by Eclipse. The same approach is taken to the creation of equals and hashCode methods. However, none of these approaches provides for a simple and fast mechanism to query a bean for the properties it exposes.

Joda-Beans provides a solution. As a developer, you just write the fields much as you would today. Then you add annotations to the bean and properties. Finally, you run a code generator, which creates the get/set methods plus framework methods that allow the properties to be effectively queried. A key point is that the code generator may be run again and again on the Java file, and is non-destructive.

  public final class Foo implements Bean {
    /** The forename. */
    private String forename;

    /** The surname. */
    @PropertyDefinition(validate = "notNull")
    private String surname;

    /** The address of the person. */
    private Address address;
    // Joda-Beans will code generate all getters, setters, equals, hashCode, toString and property accessors

See these sample classes used for testing - a simple user account class, example usage, example of validation.

As well as mutable beans following the Java Bean specification. Joda-Beans supports the creation of immutable beans. One of the biggest issues with using immutable objects in Java is their creation. Joda-Beans simplifies this by code generating builder classes for each immutable bean:

  // using code generated immutable bean builders, example showing an interest rate swap leg
  FixedRateSwapLeg payLeg = FixedRateSwapLeg.builder()
      .startDate(LocalDate.of(2014, 9, 12))
      .endDate(LocalDate.of(2021, 9, 12))
      .notional(CurrencyAmount.of(Currency.USD, 100_000_000))

Once beans and properties are defined, it is possible to use them in powerful ways. A fast and efficient serialization mechanism is provided to read and write JSON, XML and binary using Joda-Convert for object to string conversion. Further integration is included for MongoDB and Freemarker.


Release 2.1 is the current release. This release is considered stable and worthy of the 2.x tag. There are only minor incompatibilities with the 1.x codebase.

Joda-Beans requires Java SE 8 or later and depends on Joda-Convert. There are a number of optional dependencies which help with integration.

Available in Maven Central.


For Java SE 6 compatibility, use release 1.14.

See the related projects page for Maven, Gradle and IntelliJ integration.

Back to top

Version: 2.1. Last Published: 2018-02-19.

Reflow Maven skin by Andrius Velykis.