Generator is the base class for model element performing code generation.
Generator final context is constucted in the following order:
If context map is not blank then it is parsed as YAML and used to construct a generation context or contexts from the current context. If contextMap value is string then it is used as a relative URL to load a YAML resource with context mapping. The resource is processed in the same way as the context map text. If it is a map then then the map is interpolated by the current context and wrapped into a context. If the value is a list then each of its elements is processed as explained here to produce a mapped context. In this case the generator is executed once for each list element for each iterator entry (nested loop).
Generator creates work only if this attribute is true. The purpose of this attribute is to help with generator model development by disabling model parts which are still work in progress and would fail the generation process, or, on the opposite, already working parts which would create delay and distraction in testing and troubleshooting. Use
Iterator for conditional generation.
Iterator contains context property name and allows to execute generator zero or more times depending on the property type.
my-propertyproperty of the sub-context maps to
my-component/my-propertyproperty of the parent context.
false- generator is not executed.
true- generator is executed once with the current context, same as for a blank iterator.
Diagnostics to add validation messages to.