JavaBeans Generator

Motto:
"It is trivial to write a JavaBean the wrong way,
but not so easy to write it properly and maintain it consistent..."

JavaBeans Generator generates JavaBeans source files based on a simple XML configuration file.

That means you write a configuration file like this:

<bean class="jbg.tutorial.Person">
  <property name="name">
    <simple-type type="string" />
  </property>
  <property name="birthDate">
    <simple-type type="date" />
  </property>
</bean>

And automatically generated you get:

  • Full-fledged Java source file with a JavaBean corresponding to the simple configuration, including properly implemented constructors, getters, setters, hashCode(), equals() and toString() methods.
  • HTML documentation of the bean configuration within the project site.

This brings the following benefits to your bean Java sources:

  • Developed faster. The XML elements pop up automatically based on an XSD. It is a way faster to configure this XML than it is to write the corresponding Java source properly.
  • Easier to develop. You don't have to worry about the plumbing - it gets generated automatically.
  • Always correct, complete and consistent. Since the source is generated, you will not make any mistakes or omissions, having the implementation complete and correct including methods like hashCode(), and having the source always consistent (e.g. equals() consistent with hashCode()).
  • Easier to maintain. The assured consistency will pay back most during the maintenance.

JBG prerequisites

The following are prerequisites to be able to use JBG:

  • Java 1.5+ (generated sources use parameterized types)
  • Maven 2+

Tutorial

See the JBG Tutorial to start using JBG in you own applications.

Feature list

See the list of JBG features for a reference of what is supported by JBG.


 


JBG is hosted by Sourceforge.net, see JBG at Sourceforge.net.

JBG is part of SEAF.