LibraryLink ToToggle FramesPrintFeedback

Generating Java Classes for Simple Types

By default, named simple types do not result in generated types unless they are enumerations. Elements defined using a simple type are mapped to properties of a Java primitive type.

There are instances when you need to have simple types generated into Java classes, such as is when you want to use type substitution.

To instruct the code generators to generate classes for all globally defined simple types, set the globalBindings customization element's mapSimpleTypeDef to true.

To instruct the code generators to create Java classes for named simple types add the globalBinding element's mapSimpleTypeDef attribute and set its value to true.

Example 16.13 shows an in-line customization that forces the code generator to generate Java classes for named simple types.


Example 16.14 shows an external binding file that customizes the generation of simple types.


[Important]Important

This customization only affects named simple types that are defined in the global scope.

The class generated for a simple type has one property called value. The value property is of the Java type defined by the mappings in Primitive Types. The generated class has a getter and a setter for the value property.

Example 16.16 shows the Java class generated for the simple type defined in Example 16.15.