Altova MapForce 2024 Professional Edition

MapForce ActiveX components can be accessed from Java code. Java integration is provided by the libraries listed below. These libraries are available in the folder <ApplicationFolder>\Examples\JavaAPI of your MapForce installation, after you have installed both MapForce and the MapForce Integration Package (see also Prerequisites).


AltovaAutomation.dll: a JNI wrapper for Altova automation servers (in case of the 32-bit installation of MapForce)

AltovaAutomation_x64.dll: a JNI wrapper for Altova automation servers (in case of the 64-bit installation of MapForce)

AltovaAutomation.jar: Java classes to access Altova automation servers

MapForceActiveX.jar: Java classes that wrap the MapForce ActiveX interface a Javadoc file containing help documentation for the Java interface


Note:In order to use the Java ActiveX integration, the .dll and .jar files must be included in the Java class search path.


Example Java project

An example Java project is supplied with your product installation. You can test the Java project and modify and use it as you like. For more details, see Example Java Project.


Rules for mapping the ActiveX Control names to Java

For the documentation of ActiveX controls, see Object Reference. Note that the object naming conventions are slightly different in Java compared to other languages. Namely, the rules for mapping between the ActiveX controls and the Java wrapper are as follows:


Classes and class names
For every component of the MapForce ActiveX interface a Java class exists with the name of the component.


Method names
Method names on the Java interface are the same as used on the COM interfaces but start with a small letter to conform to Java naming conventions. To access COM properties, Java methods that prefix the property name with get and set can be used. If a property does not support write-access, no setter method is available. Example: For the IntegrationLevel property of the MapForceControl, the Java methods getIntegrationLevel and setIntegrationLevel are available.



For every enumeration defined in the ActiveX interface, a Java enumeration is defined with the same name and values.


Events and event handlers

For every interface in the automation interface that supports events, a Java interface with the same name plus 'Event' is available. To simplify the overloading of single events, a Java class with default implementations for all events is provided. The name of this Java class is the name of the event interface plus 'DefaultHandler'. For example:

MapForceControl: Java class to access the application

MapForceControlEvents: Events interface for the MapForceControl

MapForceControlEventsDefaultHandler: Default handler for MapForceControlEvents


Exceptions to mapping rules

There are some exceptions to the rules listed above. These are listed below:



Changes in Java class

MapForceControlDocument, method New

Renamed to newDocument

MapForceControlDocument, method OpenDocument

Removed. Use the Open method

MapForceControlDocument, method NewDocument

Removed. Use the newDocument method

MapForceControlDocument, method SaveDocument

Removed. Use the Save method



This section

This section shows how some basic MapForce ActiveX functionality can be accessed from Java code. It is organized into the following sub-sections:


Example Java Project

Creating the ActiveX Controls

Loading Data in the Controls

Basic Event Handling


UI Update Event Handling

Creating a MapForce Mapping Table


© 2018-2024 Altova GmbH