Current uses of JavaBeans

This document is an attempt to capture as many uses of JavaBeans v1.0 as possible. If you know of an open source project (or an interesting closed source one) that makes use of the JavaBeans v1.0 spec in some way, we’d love to have it listed here.

Serialization tools

Jackson.

  • General purpose, widely used, serialization, originally JSON, but now many formats.
  • Getter/setter pattern for basic data binding.
  • Annotations can be used for extra control.
  • Can use getters for collections as effective setters.
  • Direct field access can be used.
  • Non public getters/setters can be used.
  • Constructors/factories handled using annotations. See creators.
  • Can generate bytecode to avoid reflection. See afterburner.
  • Has “property missing” support.

Genson

  • Uses getter/setter pattern and no-args constructors.
  • Also uses fields.
  • Non public getters/setters/fields can be used.
  • Can use constructors, handling immutable objects, either by annotation or bytecode analysis. source
  • Can use factories, handling immutable objects, by annotation.
  • Serialize/deserialize to/from bean source.
  • Property mutator and accessor.
  • Property.

JSR-353

  • Does not appear to use JavaBeans.

JAXB

  • General purpose XML serialization.
  • Getter/setter pattern.
  • Direct field access can be used.
  • TODO

JIBX

  • TODO

BeanIO

  • Support for XML, CSV, delimited and fixed length stream formats
  • XML, Java annotations or builder API based field mapping
  • General abstraction over beans and properties
  • Property accessor works on PropertyDescriptor, constructor parameters, fields and maps
public interface Property {
  int type();  // simple, complex, array, collection, map, aggregation array/collection
  String getName();
  void clearValue(ParsingContext context);
  Object createValue(ParsingContext context);
  Object getValue(ParsingContext context);
  void setValue(ParsingContext context, Object value);
  boolean defines(Object value);
  boolean isIdentifier();
  void setIdentifier(boolean identifier);
  PropertyAccessor getAccessor();
  void setAccessor(PropertyAccessor accessor);
  Class<?> getType();
  void setType(Class<?> type);
}
public interface PropertyAccessor {
  Object getValue(Object bean);
  void setValue(Object bean, Object value);
  boolean isConstructorArgument();
  int getConstructorArgumentIndex();
}

Database tools

Hibernate

UJORM

JPA

DevWorks on JPA metamodel

Bean mapping tools

MapStruct

  • General purpose mapper, operating by annotation processor.
  • Uses getter/setter pattern and no-args constructors.
  • Can use getters for collections as effective setters.
  • Can use adders for collections as effective setters.
  • Can match simple plural property names for collections.
  • Additional coding handles immutable objects.

Orika

  • General purpose mapper, operating by Javassist.
  • Uses java.beans Introspector, with additional handling. Code.
  • Has own Property class.
  • Uses getter/setter pattern.
  • Can be specified to use constructors, using Paranamer.
  • Has plugin point for factories and unusual constructors.
  • Can access list indices and map keys.
  • Can use non-standard methods via stringly-typed syntax or builder.

Dozer

  • General purpose mapper, operating by Commons BeanUtils.
  • Eclipse GUI for editing XML based mapping files, annotation/Java config too.
  • Uses getter/setter pattern and no-args constructors.
  • Support for factories, details unclear.
  • Can access private fields.
  • Handles custom getter/setter names.
  • Handles adder methods.
  • Property access source code

JMapper

  • General purpose mapper, operating by Javassist.
  • Uses getter/setter pattern and no-args constructors.
  • Unable to find source code for introspecting.

EZMorph

  • General purpose mapper, operating by Commons BeanUtils.
  • Handles DynaBeans.
  • Uses getter/setter pattern and no-args constructors.
  • Little documentation, last release 2008.
  • Property access source code

Morph

ModelMapper

  • General purpose mapper.
  • Uses getter/setter pattern and no-args constructors.
  • Providers allow for other object creation approaches, but still needs setters.
  • Can match non-public methods and fields.
  • Can read data from non-beans using ValueReader.
  • Has PropertyInfo.

Transmorph

  • General purpose mapper, operating by reflection.
  • Uses getter/setter pattern and no-args constructors. source
  • Simulates java.beans introspector
  • Can map bean to/from Map.
  • Little documentation, last release 2013.

OTOM

  • General purpose mapper.
  • GUI tool that generates Java source code.
  • Uses getter/setter pattern and no-args constructors.
  • Uses java.beans Introspector.
  • Little documentation, last commit 2005.

Smooks

  • General purpose data event based data transformation.
  • Uses getter/setter pattern and no-args constructors.
  • Support for factory methods to create objects.
  • Some support for setting fields directly.

Web GUIs

Apache ISIS

FXForm2

Vaadin

  • Property class
  • interface over type 2 or 3, implementations provided to access bean via methods or to hold state
  public interface Property<T> {
    getType()
    getValue()
    isReadOnly()
    setReadOnly(boolean flag)
    setValue(T value) 
  }

Tapestry

Direct web remoting

  • Property interface
  • interface of type 1
  • implementations for getter/setter pair, field, one parameter (in a constructor or method), and a stateful one?
  • also has type conversion
  • located in an advanced package, not for general use
public interface Property {
  Property createChild(int index)  // access nested generic type info of List<Map<String, Integer>>
  String getName()
  Class<?> getPropertyType()
  Object getValue(Object bean)
  void setValue(Object bean, Object value)
}

Templating tools

Freemarker

  • Abstracts data access, one implementation is based on JavaBeans.
  • Uses getters.
  • Uses java.beans Introspector. source

Velocity

  • TODO

Utilities

Spring BeanUtils

Commons BeanUtils

JUEL

MVEL

OGNL

Bean validation

  • Solution must work with bean validation

JBeans

  • Package to replace java.beans
  • Includes type 1 property
  • Javadoc

Other

Integrated data viewer

  • type 2/3 property interface
public interface Property {
  void addPropertyChangeListener(PropertyChangeListener listener)
  void addVetoableChangeListener(VetoableChangeListener listener)
  void clearValue()
  String getName()
  Object getSourceBean()
  Object getValue()
  boolean isReporting()
  boolean isVetoable()
  void notifyListeners()
  void removePropertyChangeListener(PropertyChangeListener listener)
  void removeVetoableChangeListener(VetoableChangeListener listener)
  void setReporting(boolean reportChanges)
  void setValue(Object newValue)
  void setValueAndNotifyListeners(Object newValue)
}

Atomikos

public interface Property {
  String[] getAllowedValues()
  String getDescription()
  Editor getEditor()
  IndexedProperty getIndexedProperty()
  String getName()
  Class getType()
  Object getValue()
  boolean isExpert()
  boolean isHidden()
  boolean isPreferred()
  boolean isReadOnly()
  void setValue(Object arg) 
}

Programming languages

Java

Groovy - TODO

Gosu

Back to top

Version: 0.1-SNAPSHOT. Last Published: 2015-01-03.

Reflow Maven skin by Andrius Velykis.