Extending the data handler base class

To create a custom data handler, you extend the data-handler base class (DataHandler) to create your own data-handler class. The DataHandler class contains methods that perform the conversions (string-to-business-object and business-object-to-string), as well as utility methods to assist in development. The EDK contains stub code and makefiles for a custom data handler. The stub file contains Java code that defines an empty class listing all the methods that you must implement. You can use the stub file as a template to generate a custom data handler.

To create a data handler source file using the stub file:

  1. Copy the StubDataHandler.java file and rename it so that its name matches the name of the data-handler class that it defines.

    The stub file resides in the DevelopmentKits\edk\DataHandler subdirectory in the product directory. It includes import statements that import the data handler package com.crossworlds.DataHandlers. It also imports some classes from the Java Connector Development Kit.

  2. Change the StubDataHandler keyword to the name of the class that implements your custom data handler.

    For example, the following line extends the DataHandler class to create a custom data-handler class called HtmlDataHandler:

    public class HtmlDataHandler extends DataHandler
    

Copyright IBM Corp. 1997, 2004