-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestsubject: code generationThis issue is about code generationThis issue is about code generation
Description
Based on this contribution which adds syntactical support for conditions on type aliases, we should enhance our validator generator so it properly uses those conditions.
Example: let's say we want to define a string type that must have an odd number of characters and consists out of a specific configurable amount of words:
typeAlias MyAlias(numberOfWords int):
OtherAlias(true)
condition MustHaveSpecificNumberOfWords:
GetNumberOfWords = numberOfWords
typeAlias OtherAlias(isOddLength boolean):
string
condition LengthIsOdd:
if isOddLength
then CheckLengthIsOdd
type Foo:
attr1 MyAlias(2) (1..1)
attr2 MyAlias(3) (0..*)
This should:
- generate condition classes for the conditions on
MyAliasandOtherAlias, - call these conditions in the type format validator of
Foo.
Note that these alias conditions must be parameterized accordingly, so they will not implement the Validator<String> interface.
Prerequisites:
- Syntax contribution from TradeHeader: Adding condition support in typeAlias #909
- Injection support for validators: Type format validators and cardinality validators should be injected #927
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestsubject: code generationThis issue is about code generationThis issue is about code generation
Type
Projects
Status
Closed