The Talon Manual

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<!-- Defines fields which may be referenced by other model elements-->
<fields>
	<field name="myStringField" type="String" id="10000" length="16" doc="My String field" />
</fields>
 
<messages>
	<message name="Message" factoryid="1" id="1">
    	<fieldRef  ref="myStringField" name="myField"required="true" />
    	<field name="myOtherField" type="String" length="16" id=10001" doc="My Other String field" />
	</message>
</messages> 
Field Attributes
AttributeDescriptionRequired
type

The type of the element. If the type is defined in this namespace or is a primitive or collection type, only the simple name of the type need be used. If the type belongs to another namespace from an imported file, then the fully qualified name should be used. If the field is an arraytype, it should be suffixed with array indices such as MyEntity[] to denote it as an array.

(tick)
nameThe name of the field, must be unique within the model.(tick)
jsonName

Contains the name of the JSON property that will be used for the field when the message is serialized to JSON. Defaults to use the value defined in name.

 
id

The id of the field. The id must be unique with the scope of the containing type. For Xbuf/Protobuf encoding this tag is used as the tag value for the field on the wire. If not set, a unique id will be generated by the source code generator. For better control over compatibility it is reccomended that the application set this value manually.

Field ids must be between 0 and 32767 inclusive

 
length

If this field refers to a variable length type (such as string), this indicates the maximum length of the field.

 
docA brief, one line string describing the field. If more detailed documentation is desired, a child <documentation> element may be used. 
deprecatedWhen true all methods generated for the field will marked as deprecated. 

...