ADB Tweaking Guide

Introduction

ADB is written with future extensions in mind, with a clear and flexible way to extend or modify it's functionality. This document explains available mechanisms to extend ADB and possibly adopt it to compile schemas to support other languages.

Know the Configuration

The configuration for the ADB framework is in the schema-compile.properties file found in the org.apache.axis2.databinding.schema package. This properties file has the following important properties

The First Tweak - Generate Plain Java Beans

The first, most simple tweak for the code generator could be to switch to plain bean generation. The default behavior of the ADB framework is to generate ADBBeans, but most users, if they want to use ADB as a standalone compiler, would love to have plain java beans. This can infact be done by simply changing the template used.

The template for plain java beans is already available in the org.apache.axis2.schema.template package. To make this work replace the /org/apache/axis2/databinding/schema/template/ADBBeanTemplate.xsl with the /org/apache/axis2/databinding/schema/template/PlainBeanTemplate.xsl in the schema-compile.properties.

Congratualtions! You just tweaked ADB to generate plain java beans.

To generate custom formats, the templates need to be modified. The schema for the xml generated by the JavaBeanWriter is availble in the source tree under the Other directory in the codegen module. Advanced users with knowledge of XSLT can easily modify the templates to generate code in their own formats.

A More Advanced Tweak - Generate Code for Another Language

To generate code for another language, there are two main components are to be written.

Surprisngly this is enough to have other language support for ADB. Change the configuration and you are ready to generate code for other lanuages!

This tweaking guide is supposed to be a simple guideline for anyone who wishes to dig deep into the mechanics of the ADB code generator. Users are free experiment with it and modify the schema compiler accordingly to their needs.