15.3 Generating and Using Java Code from the Configuration Contract

DTK provides a tool for generating Java code from the configuration contract XML file. The tool is included in the devkit.jar file.

Example - Tool to generate Java code

The tool is executed using the following command:

java -cp devkit.jar com.digitalroute.devkit.tools.ContractGen \ 
     -d <output dir> -f <configuration contract file>

For each field in the configuration contract, a corresponding inner class is generated. This class should not be used from the agent, instead the field is accessed through public accessor (get and set) methods. Each field also has an active flag which is used when a field gets enabled/disabled from the agent's user interface.