<types> <simpleType name="string1" baseType="string" /> <simpleType name="string2" baseType="string" maxLength="20" /> </types>In this example, the "string1" type does not have a maximum length, but the "string2" type has a maximum length of 20 characters.
int
types which have specified enumeration states:<types> <enumType name="intEnum" > <enumValue name="ONE" /> <enumValue name="TWO" /> </enumType> </types>In the following type definition, "ONE" will have the value 1, and "TWO" the value 2:
<types> <enumType name="intEnum" > <enumValue name="ONE" value="1" /> <enumValue name="TWO" value="2"/> </enumType> </types>Note that enum types are derived from int types, and as such they have the same compatibility map as int types.
<types> <enumType name="intEnum" > <enumValue name="ONE" value="16" /> <enumValue name="TWO" value="32"/> </enumType> </types>and:
<types> <enumType name="intEnum" > <enumValue name="ONE" value="0x10" /> <enumValue name="TWO" value="0x20"/> </enumType> </types>
fileExist
: indicates if the URL must exist. The supported values are:any
: (the default) the existence of the URL is not importantexist
: the URL must existnotExist
: the URL must not existfileType
: indicates the type of the URL. The supported values are:any
: (the default) the type of the URL is not importantfile
: the URL must be a Filedirectory
: the URL must be a Directoryextension
: the optional extension of the URL<types> <urlType name="url" /> <urlType name="url2" fileExist="exist" fileType="directory"/> <urlType name="url2" fileExist="noExist" fileType="file" extension="xml"/> </types>
string
types which can easily be set or get as XML Nodes, or as Strings. It is possible to define an XML Schema for which the type must be consistent.<types> <xmlType name="xml" /> <xmlType name="xml2" schema="schema.xsd"/> </types>
string
types which can easily be set or get as JSONElement
[1]
JSONObject
or JSONArray
<types> <jsonType name="myJSON" /> </types>
any
type is a built-in simple type which can contain any simple type value. The interest of this type is that the type of the value can change.<types> <anyType name="myType" /> </types>
nil
type is a built-in simple type which can be refered to (but not defined). It allows to define a data with an unused value. elements of this type will always have the false
value.<types> <simpleType name="toggleState" baseType="boolean" /> <unionType name="guiEvent" variant="int" > <member name="button1" type="nil" /> <member name="button2" type="nil" /> <member name="toggle1" type="toggleState" /> <member name="toggle2" type="toggleState" /> </structType> </types>
float
and double
types can be associated with their unit. The supported units are:m
: meterft
: feetin
: inchnm
: nautical miledeg
: degreedeg360
: degree normalized in the [0, 360] rangedeg180
: degree normalized in the [-180, 180] rangerad
: radianmrd
: milliradiantr
: "tour" (180 degrees = -0.5, -180 degrees = -0.5)m/s
: meter per secondm/s2
or ms2
: meter per second squaredg
: G-forcefr/s
: feet per secondfr/min
: feet per minuteknot
: knotsrad/s
: radian per seconddeg/s
: degree per secondkg
: kilogramlb
: poundms
: millisecondutc
: utcepoch
: epochs
: secondminute
: minutehour
: hourutc
and epoch
units are aliases for ms
(millisecond).
<types> <simpleType name="selected" baseType="boolean" defaultValue="true" /> <simpleType name="speed" baseType="float" defaultValue="1.2"/> <simpleType name="count" baseType="int" defaultValue="10"/> <simpleType name="name" baseType="string" defaultValue="UNNAMED"/> <enumType name="intEnum" defaultValue="TWO" > <enumValue name="ONE" /> <enumValue name="TWO" /> </enumType> </types>If the default value is not set, the framework will set a default value depending on the type:
false
for a boolean
typejsonType
typestring
and xmlType
types<types> <simpleType name="count" baseType="int" defaultValue="0x0D"/> </types>
<types> <simpleType name="selected" baseType="boolean" /> <simpleType name="speed" baseType="float" unit="m/s" /> <simpleType name="latitude" baseType="double" unit="deg" /> <simpleType name="longitude" baseType="double" unit="deg" /> <simpleType name="altitude" baseType="double" unit="ft" /> <enumType name="intEnum" > <enumValue name="ONE" /> <enumValue name="TWO" /> </enumType> </types>
<types> <simpleType name="int" baseType="int" /> <arrayType name="arrayOfInt" type="int" /> <aliasType name="click" type="nil" /> <aliasType name="aliasArray" type="arrayOfInt" /> </types>
<types> <simpleType name="int" baseType="int" /> <simpleType name="bool" baseType="boolean" /> <switchType name="theSwitch" types="int bool" /> </types>Each of the possible types is specified by its associated index. For example in the case above,
int
would have the index 0, and bool
the index 1.
<types> <simpleType name="int" baseType="int" /> <arrayType name="arrayOfInt" type="int" /> </types>Arrays can have a specified maximum size. For example:
<types> <simpleType name="int" baseType="int" /> <arrayType name="arrayOfInt" type="int" maxSize="10" /> </types>Arrays can also have a specified fixed size[2]
<types> <simpleType name="int" baseType="int" /> <arrayType name="arrayOfInt" type="int" fixedSize="10" /> </types>
<types> <simpleType name="bool" baseType="boolean" /> <simpleType name="int" baseType="int" /> <structType name="struct"> <field name="field1" type="bool" /> <field name="field2" type="int" /> </structType> </types>
<types> <simpleType name="bool" baseType="boolean" /> <simpleType name="int" baseType="int" /> <unionType name="myUnion" variant="int" > <member name="member1" type="bool" /> <member name="member2" type="int" /> </structType> </types>The "variant" attribute specifies the type of the variant, which must be an "int" type (it can be an enum type).
<types> <simpleType name="toggleState" baseType="boolean" /> <unionType name="guiEvent" variant="int" > <member name="button1" type="nil" /> <member name="button2" type="nil" /> <member name="toggle1" type="toggleState" /> <member name="toggle2" type="toggleState" /> </structType> </types>As you can see, in the above example, events with no associated content, such as button press events, can be associated with a field of the nil type.
<services> <event name="guiEvent" > <data name="event" type="guiEvent" /> </event> </services>
<types> <simpleType name="int" baseType="int" /> <simpleType name="string" baseType="string" /> <mapType name="map" keyType="string" valueType="int" /> </types>
my.package.MyClass
class:<types> <objectType name="obj" class="my.package.MyClass" /> </types>There are two constraints for the class which backs this type:
class
should be defined for the default values using the defaultClass
attrbute. For example this declaration is incorrect because it is not possible to create a List
with an empty constructor.<types> <objectType name="obj" class="java.util.List" /> </types>Instead this declaration is valid:
<types> <objectType name="obj" class="java.util.List" defaultClass="java.util.ArrayList" /> </types>
<types> <simpleType name="int" baseType="int" /> <simpleType name="float" baseType="float" /> <structType name="struct"> <field name="aircraftID" type="int" continuous="false" /> <field name="aircraftLongitude" type="float" /> <field name="aircraftLatitude" type="float" /> </structType> </types>
isAbstract
attribute which specifies if the type is abstract, meaning that it can not be directly used in a data or a field. For example:<types> <simpleType name="int" baseType="int" /> <simpleType name="float" baseType="float" /> <structType name="abstractPosition" isAbstract="true"> <field name="latitude" type="float" /> <field name="lontitude" type="float" /> </structType> </types>
<types> <simpleType name="bool" baseType="boolean" /> <simpleType name="bool2" baseType="boolean" /> <simpleType name="int" baseType="int" /> <simpleType name="int2" baseType="int" /> <enumType name="intEnum" > <enumValue name="ONE" /> <enumValue name="TWO" /> </enumType> <enumType name="intEnum2" > <enumValue name="ONE" /> <enumValue name="THREE" /> </enumType> <enumType name="intEnum3" > <enumValue name="ONE" /> <enumValue name="TWO" /> <enumValue name="THREE" /> </enumType> <arrayType name="arrayOfInt" type="int" /> <arrayType name="arrayOfInt2" type="int" /> <arrayType name="arrayOfBool" type="bool" /> <structType name="struct"> <field name="intArray" type="arrayOfInt" /> <field name="enum" type="intEnum" /> <field name="int" type="int" /> </structType> <structType name="struct2"> <field name="intArray" type="arrayOfInt2" /> <field name="enum" type="intEnum" /> <field name="int" type="int" /> </structType> <structType name="struct3"> <field name="enum" type="intEnum" /> <field name="int" type="int" /> <field name="intArray" type="arrayOfInt" /> </structType> </types>In this example:
<types> <simpleType name="bool" desc="the base boolean type" baseType="boolean" /> <simpleType name="int" desc="the base int type" baseType="int" /> <structType name="struct"> <field name="field1" desc="my first field" type="bool" /> <field name="field2" desc="my second field" type="int" /> </structType> </types>
namespace
element as a parent of the types declaration[4]
<types> <namespace uri="http://mydomain.com/common" > <type name="bool"> <type name="position"> </namespace> </services>
<types> <simpleType name="bool" baseType="boolean" /> <simpleType name="int" baseType="int" /> <enumType name="intEnum" > <enumValue name="ONE" /> <enumValue name="TWO" /> </enumType> <arrayType name="arrayOfInt" type="int" /> <structType name="struct"> <field name="intArray" type="arrayOfInt" /> <field name="enum" type="intEnum" /> <field name="int" type="int" /> </structType> </types>
JSONObject
or JSONArray
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence