Major
Nice to have
Bugfix
Major
Enhancement
It should be easy to define a TL-Model data type that is represented in Java code by a Java-Enum.
For cases where Java code makes decisions based on a choice in a model attribute, it may be better/easier to use a Java enum as the value type than a TLEnumeration, since the classification values are wired to the code.
Application
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 internationalization of the values is done as usual 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
- Attribute timeUnit in tl-demo in type A.