major
nice-to-have
defect
major
enhancement
It should be easy to define a TL-Model data type that is represented in Java code by a Java enum.
In cases where Java code makes decisions based on a selection in a model attribute, it may be better or easier to use a Java enum as the value type rather than a TLEnumeration, since the values of the classification are hard-coded into the code.
Usage
Such a TLPrimitive type is defined as follows:
#!xml
<datatype name="MyEnum" kind="Custom" db_type="string">
<annotations>
<config-type value="ENUM"/>
</annotations>
<enum-storage enum="my.package.MyEnum" />
</datatype>
Display
The values are internationalized as is customary for enums:
java.util.concurrent.TimeUnit.DAYS = d java.util.concurrent.TimeUnit.HOURS = h java.util.concurrent.TimeUnit.MICROSECONDS = µs java.util.concurrent.TimeUnit.MILLISECONDS = ms java.util.concurrent.TimeUnit.MINUTES = min java.util.concurrent.TimeUnit.NANOSECONDS = ns java.util.concurrent.TimeUnit.SECONDS = s
Test
- The ` timeUnit ` attribute in ` tl-demo ` in Type A.