To create your own generator you simply have to implement HibernateMappingProcessorLiason or extend an existing implementation such as AbstractXsltBasedGenerator.

Using your custom generator

To use your custom generator with Md4j you have to simply put it in the classpath or in Ant's lib folder, then instruct Md4j to use it. Md4j Ant task instantiates, configures and executes the generators found as a whitespace seperated list of class names in its generators attribute. The attribute by default uses HibernateDaoGenerator, Ejb21Generator and StrutsAction1Generator.

Your generator will be able to obtain information/parameters provided by Md4j in it's init() method. For more information on what the context information is and how to provide additional information to your generator through the nested contextParam elements of the Md4j task check out the Ant Build HOWTO.