...
Attribute | Description | Required |
---|---|---|
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. The best practice when importing a type from another model is to use the fully qualified name of the imported type (e.g. com.example.importedmodel.MyEntity), as this insulates your model from future conflicts in the event that imported models are changed. If the field is an arraytype, it should be suffixed with array indices such as MyEntity[] to denote it as an array. | ![]() |
name | The name of the field, must be unique within the model. | ![]() |
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. | |
doc | A brief, one line string describing the field. If more detailed documentation is desired, a child <documentation> element may be used. | |
deprecated | When true all methods generated for the field will marked as deprecated. |
...
Attribute | Description | Required |
---|---|---|
ref | The name of the referenced field. Name may be with or without the namespace of owner model (i.e. full-qualified name). In both cases, field will be looked up in both current model and its imports. If non-fully-qualified name is declared in current model and in one of imports, the field from current model will take precedence. If multiple imports define the same name, an error will be reported. Best correction in such case The best practice when importing a field from another model is to use fully qualified name of the imported field (e.g. com.example.importedmodel.someField), as this insulates your model from future conflicts in the event that imported models are changed. | ![]() |
name | Optionally, a name for the field that overrides the referenced field's name. Otherwise the field name defaults to that of the referenced field. | |
jsonName | Optionally overrides the referenced field's jsonName. | |
id | Optionally overrides the id specified by the field being referenced. Field ids must be between 0 and 32767 inclusive | |
required | Whether or not the field is a required field for the type. Fields declared as required will cause a check to be added for the value being set in the generated types isValid() method. | |
pinned | Indicates whether or not the field is pinned. A pinned field always occupies the same space on the wire. | |
isKey | True if this field should serve as the key when inserting the entity into a LongMap or StringMap collection. In this case, insertion of the message in the collection with a given key will update this field with the key value. | |
doc | The doc to use for the field which overrides that specified by the referenced field. | |
deprecated | When true all methods generated for the field will marked as deprecated. |
...