-
Notifications
You must be signed in to change notification settings - Fork 4
How to validate MetaInfo elements?
The advantage of the MOGLiCC Standard Model is its simpleness, its disadvantage the large number of MetaInfo elements and the danger to lose the overview which MetaInfo element is really being used. This is one reason for the MetaInfo Validation Feature. A second reason is the importance specific MetaInfo elements can have, for instance, without a MetaInfo element “JavaType” it would not be possible to build a JavaBean artefact with a reasonable content. It would be good to assure that for all classes in the model a java type is defined.
Therefore the existing generator plugins implement the interface MetaInfoValidatorVendor and its method “getMetaInfoValidatorList()”. MetaInfoValidators are defined in the MetaInfo validation file called “MetaInfo.validation”. This file is located in the plugin input directory of the generator plugin. For more information how to define MetaInfoValidators, see the default MetaInfo validation file. The StandardModelProvider collects all of these MetaInfoValidators and uses this information for two purposes: 1. to throw an exception if a mandatory MetaInfo element is missing and 2. to create a statistics file that informs which MetaInfo element is used in which context and that warns if a MetaInfo element or a MetaInfo Validator is unused. You find this statistics file in the plugin output directory of the StandardModelProvider.
[Back] (https://github.com/iks-github/MOGLiCodeCreator/wiki/How-to-apply-MOGLiCC%3F)