Altova UModel 2024 Enterprise Edition

This section provides reference to the objects of the UModel COM API. The objects are described in a generic manner, since the API may be used with virtually any language that supports calling a COM object. For language-specific examples, see:

 

Example C# Project

Example Java Project

JScript Examples

 

The API reference contains two main sections, each describing the interfaces and the enumeration types used in the API, respectively. The enumeration values contain both the string name and a numeric value. If your scripting environment does not support enumerations, use the number-values instead.

 

In .NET, for every interface of the UModel COM automation interface, a .NET class exists with the same name. Also, COM types will be converted to the appropriate .NET type. For example, a type such as Long in the COM API would appear as System.Int32 in .NET.

 

In Java, note the following syntax variations:

 

Classes and class names. For every interface of the COM automation interface, a Java class exists with the name of the interface.

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. For example, for the Name property of the Document interface, the Java methods getName and setName are available.

Enumerations. For every enumeration defined in the automation 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:

 

Application // Java class to access the application

ApplicationEvents // Events interface for the application

ApplicationEventsDefaultHandler // Default handler for "ApplicationEvents"

 

UModel API Errors

The UModel API may return the error codes listed below.

 

1000

The application object is no longer valid.

1001

Invalid parameter or invalid address for the return parameter was specified.

1002

UModel API is not available in the current edition.

1003

Model Transformations are not supported in the current edition.

1050

Macro not found

1051

Invalid (nested) macro execution

1100

Error when saving file, probably the file name is invalid.

1101

Invalid (duplicate) call to BeginModification.

1102

EndModification called without BeginModification

1200

Error deleting file at URL.

1201

Error creating directory at URL.

 

The UMLData interfaces have specific errors, see UMLData Interfaces.

© 2018-2024 Altova GmbH