uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

6.9.2 Creating the Java form file

The Java form file is the form of the Java program describing the configuration of the package, class and method (including argument) for developing the transformation function. The Java form file is created automatically by uCosminexus Service Architect on the basis of the transformation function definition file.

The following is an example of the Java form file. The slanting part is data entered from the transformation function definition file.

Example of not having NodeList type in Method definition is as follows:

 
/**
 * Java Template
 */
 
package jp.co.Hitachi.soft.sample;
 
public class SampleClass {
 
    /**
     * Description related to the custom function...
     * 
     * @param arg1
     *  Description related to the selected argument...
     * @param arg2
     *  Description related to the selected argument...
     * @param arg3
     *  Description related to the selected argument...
     *
     * @return
     */
    public static String SampleFunction(String arg1, String arg2, String arg3) {
 
        // TODO Add Java Code Here
        return "";
    }
}
 

Example of having NodeList type in Method definition is as follows:

/**
 * Java Template
 */
 
package jp.co.Hitachi.soft.cscdt.sample;
 
import org.w3c.dom.NodeList;
 
public class SampleFunctionClass {
 
    /**
     * Custom function related description...
     * 
     * @param arg1
     *  Selected argument related description...
     *
     * @return
     */
    public static String SampleStringFunction(String arg1) {
 
        // TODO Add Java Code Here
        return "";
    }
 
    /**
     * Custom function related description...
     * 
     * @param arg1
     *  Selected argument related description...
     *
     * @return
     */
    public static NodeList SampleNodeListFunction(Object arg1) {
 
        // TODO Add Java Code Here
        return null;
    }
}

Add "import org.w3c.dom.NodeList;" when 1 or more Method definitions having return value of NodeLit type in Class definition exist. However, do not add when all types of return value within Method definition is of String type.

Implement the process in // TODO Add Java Code Here and create the Java program.

The following procedure shows how to create the Java form file.

  1. In the Eclipse menu, choose File, New and Java project.
    The New Java project dialog box appears.
  2. Specify the project name and then click End.
    The Java project is created in the Eclipse workspace.
  3. Move the transformation function definition file created in 6.9.1 Creating the Transformation Function Definition File to the following location:
     
    Directory of created Java projects\src
     
  4. In the Eclipse menu, choose File and New.
    The Eclipse screen is updated.
  5. Right click the transformation function definition file in the package and explorer view and choose HCSC--Definer and Create the Java form file.
    The Java form file output wizard appears.
  6. Specify the output location and the character code set of the output file of the Java form file and then click Next.
    You can choose the output character code from MS932, UTF--8 and UTF--16. Note that in UTF--16, the BOM control code (0xFEFF) is added.
  7. Check the check box of the output class in the Java form file and then click End.
    The Java form file output wizard closes and the Java form file is created in the specified location.