ValueTypes
A ValueType describes the type of data that can be stored in a particular field of a DataElement. It specifies the format of the data and different representations in the various layers of the Application.
Several basic ValueTypes have defined in prime-core.
You can add new ValueTypes in one of 2 ways:
- Add a ValueType to one of your Components
- Add to Component
- Add as DataResource
ValueTypes are added to the valueTypes
directory.
space
└── model
├── space.xml
└── valueTypes
├── LicensePlate.xml
└── Rating.xml
The xml itself should have root tag valueType
and a type attribute (e.g. elements::SimpleValueType
).
<valueType name="LicensePlate" type="elements::SimpleValueType">
<description>For license plate String values.</description>
<prototype name="String"/>
</valueType>
To provide a ValueType through an ExpansionResource, create a valueTypes.xml file somewhere in the resources directory.
space-expanders
└── data
└── space
└── valueTypes.xml
<dataResource type="elements::SimpleValueType">
<simpleValueType name="LicensePlate">
<description>For license plate String values.</description>
<prototype name="String"/>
</simpleValueType>
</dataResource>
DataResources
Discover more about DataResources here.
Currently only SimpleValueTypes are supported. More ValueTypes will be coming in the near future.