InterfaceEnum
|
Java, Groovy, Python, JavaScript and TypeScript |
In the case of Generation Variant 1 (Interface and Rules Module) a separate method is created as standard for each individual condition and action value, the name of which is dynamically formed from the respective titles and symbols.
If conditions or actions have many values, interfaces with a corresponding number of methods are created which must all be implemented and maintained.
With the keys InterfaceEnum and InterfaceParm, only one method is generated for selected conditions or actions, in which the values are transferred either as enum or as parameters.
In the following chapters, these generation variants are called Enum and Parm generation.
Enums
ide.<ProgrammingLanguage>.InterfaceEnum[.n]
This generation parameter can be used to generate an enum for selected conditions and actions, so that instead of many methods for all values, only one method with an enum as a parameter is generated:
-
The interface methods are called isEnum (…) or doEnum (…) by default
-
The name of the enum is formed dynamically from the title of the respective condition or action
-
An enum constant $nnn is generated for each value in the table of values, where nnn is the number of the value
Parameter
ide.<ProgrammingLanguage>.InterfaceParm[.n]
With this generation parameter, only one method with the defined parameter list is generated for selected conditions and actions, instead of multiple methods for all values.
|
Data extraction
The properties of enums and the parameters of parameter lists are specified using optional arguments, for example:
-
the symbol, the title or the text of the condition or action value as a string
-
a numerical value or a list of numbers that are read directly from the symbol or the title of the value during generation
-
min and max value of an interval specification that is read directly from the symbol or the title of the value during generation
-
etc.
ide.Java.InterfaceEnum.1: Symbol = Double; Title
ide.Java.InterfaceEnum.2: Symbol; Title = DoubleList
ide.Java:
Enabled: true
Interface:
Enum:
1:
Symbol: Double
Title: '""'
2:
Symbol: '""'
Title: DoubleList
The following chapters describe options that are available for InterfaceEnum generation.