Introduction

I'll start apologizing the name of this project it isn't great! The PojoGenerator is a utility that will generate test data for your data model. This is great, for instance you have a separate back-end and frond-end development team and the backed developers are not done yet. You as frond-end developer could continue to develop you frond-end by letting the PojoGenerator fill your data model. It could also be useful when you want to develop outside the office and the database must remain there for security reasons.

How does it work

The PojoGenerator is build using spring and if your application also uses spring it's dead simple to get it going. If you do not use spring, don't worry you can still use it. The PojoGenerator works by creating Proxy object for all your domain objects, and then will use generators to create objects that these objects reference. For example we have an application that has Cats when we call the method that will retrun an Cat the pojogenerator will create a and instanticate a String witch will contain it's name. You'll would need to configure anything for this behavior. But in some cases the default behavior will not be enought. So we've build the posiblity to define how and what you'll want to generate in specific instances.

For example specify a configuration xml:

<class-definition>
   <class-descriptor id="cat" class="nl.beesting.beangenerator.example.Cat" collection-type="java.util.ArrayList"/>
   <field-descriptor name="name" class="java.lang.String" generator="reGenerator">
      <parameters>
         <parameter name="mask">
            <value><![CDATA[ [A-Z]{1}[a-z]{1,10} ]]></value>
         </parameter>
      </parameters>
   </field-descriptor>
</class-definition>

This configuration "tells" the PojoGenerator when it's creating objects of type Cat use the reqular expression generator when it's instancieting the name field.