...
Code Block |
---|
language | xml |
---|
title | Different kinds of Atom Types |
---|
linenumbers | true |
---|
|
<Def name="String" inherits="Atom"/>
<Def name="Binary" inherits="Atom"/>
<Def name="Boolean" inherits="Atom"/>
<Def name="Integer" inherits="Atom"/>
<Def name="Number" inherits="Atom"/>
<Def name="Short" inherits="Atom"/>
<Def name="Long" inherits="Atom"/>
<Def name="Byte" inherits="Atom"/>
<Def name="Float" inherits="Atom"/>
<Def name="Double" inherits="Atom"/>
<Def name="Decimal" inherits="Atom"/>
<Def name="DateTime" inherits="Atom" format="$SimpleDateFormat()"/>
<!-- Derived from Basic Primitives -->
<Def name="Clob" inherits="String"/>
<Def name="Blob" inherits="Binary"/>
<Def name="Date" inherits="DateTime"/>
<Def name="Time" inherits="DateTime"/>
<Def name="Duration" inherits="Time"/>
<Def name="YearDay" inherits="Integer"/>
<Def name="MonthDay" inherits="Integer"/>
<Def name="WeekDay" inherits="Integer"/>
<Def name="YearMonth" inherits="Integer"/>
<Def name="Year" inherits="Integer"/>
<Def name="Month" inherits="Integer"/>
<Def name="Day" inherits="Integer"/> |
Examples of Using Primitive Types
Primitive types can be used in standard containers (ThingModel, DataModel,, ThingFacet, AppModel, AppFacet) or custom containers (types) defined by users.
General Usage of Primitive Types
Code Block |
---|
language | xml |
---|
title | ZoneInfo DataModel using ZoneName as String |
---|
linenumbers | true |
---|
|
<PrimitiveTypeName Name=".." Cardinality="n..m" Alt="..." Default=""/> |
String
Code Block |
---|
language | xml |
---|
title | ZoneInfo DataModel using ZoneName as String |
---|
linenumbers | true |
---|
|
<DataModel Name="ZoneInfo">
<String name="ZoneName"/>
</DataModel> |
Array of Primitive Types
Array of Primitive types is possible using Cardinality modifier at the time of usage
Code Block |
---|
language | xml |
---|
title | ZoneInfo DataModel using ZoneName as Array of String |
---|
linenumbers | true |
---|
|
<DataModel Name="ZoneInfo">
<String name="ZoneName" cardinality="0..n"/>
</DataModel> |
DateTime
DataTime uses Java SimpleDateFormat notation. Please refer to here for SimpleDateFormat
Code Block |
---|
language | xml |
---|
title | ZoneInfo DataModel using ZoneName as String |
---|
linenumbers | true |
---|
|
<DataModel Name="ZoneInfo">
<DateTime name="RecordDate" format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss'Z')"/>
</DataModel> |