This topic describes how to create a sample Java library and configure a .mff file for it so that the library appears in the Libraries window of MapForce.
|1.||Create a new Java project in your preferred development environment (for example, Eclipse).|
|2.||Add to the project a new package called com.hello.functions which consists of a class called Hello. In the code listing below, notice that the HelloFunction function has been defined as public static.|
|3.||Optionally, if your project needs support for special schema types such as date, time, and duration, import the com.altova.types package. To obtain this package, generate Java code from a mapping without custom functions.|
|4.||Compile your custom library to a class file, and add it to the Java classpath.|
|5.||Using an XML editor, create a new .mff file and validate it against the ..\Program Files\MapForceLibraries\mff.xsd folder. Make sure that the text highlighted below points to the namespace and class defined previously in the Java code. For more information, see Configuring the .mff File.|
<?xml version="1.0" encoding="UTF-8"?>
You have now finished creating a custom library and the .mff file which adapts it to MapForce. The custom .mff file can now be used in MapForce (see Importing the .mff File Into MapForce).
© 2019 Altova GmbH