A DataTypeDefinition defines a representation of a UADataType that can be used by design tools to automatically create serialization code. The fields in the DataTypeDefinition type are defined in Table F.12.

This field may not be present for DataTypes that have no fields. Code generators may choose to create a class with no fields if the programming environment supports the concept.

Table F.12 – DataTypeDefinition

Element

Type

Description

Name

QualifiedName

A unique name for the data type.

This name should be the same as the BrowseName for the containing DataType.

SymbolicName

String

A symbolic name for the data type that can be used as a class/structure name in autogenerated code. It should only be specified if the Name cannot be used for this purpose.

Only letters, digits or the underscore (‘_’) are permitted and the first character shall be a letter.

This field is only specified for nested DataTypeDefinitions.

The SymbolicName of the DataType Node is used otherwise.

BaseType

QualifiedName

Not used. Kept in schema for backward compatibility.

IsUnion

Boolean

This flag indicates if the data type represents a union.

Only one of the Fields defined for the data type is encoded into a value.

This field is optional. The default value is false.

If this value is true, the first field is the switch value.

IsOptionSet

Boolean

This flag indicates that the data type defines the OptionSetValues Property.

This field is optional. The default value is false.

Fields

DataTypeField []

The list of fields that make up the data type.

This definition assumes the structure has a sequential layout.

For enumerations, the fields are simply a list of values.

This list does not include fields inherited from a base DataType.

When Applications ingest a UANodeSet they need to follow the HasSubtype References between DataType Nodes to collect all of the fields needed to fill in the DataTypeDefinition Attribute.

The DataTypeDefinition Attribute maybe populated from the DataTypeDefinition belonging to a UADataType. If the UADataType is a subtype of Structure the mapping to the StructureType Enumeration is specified in Table F.13.

Table F.13 – StructureType Enumeration Mapping

Value

IsUnion

Field.IsOptional

Field.AllowSubTypes

Structure

False

All False

All False

StructureWithOptionalFields

False

One or More True

All False

Union

True

All False

All False

StructureWithSubtypedValues

False

All False

One or More True

UnionWithSubtypedValues

True

All False

One or More True

Any combination of flags that does have a mapping is invalid and an error should be raised.