Skip to content

MetaInfo Validation

iks github user edited this page Jul 17, 2014 · 8 revisions

[Back to the overview of Concepts] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Concepts)


The data model of the Standard Model Provider is parsed from a text file that contains model, class and attribute definitions (see also [How to validate MetaInfo elements?] (https://github.com/iks-github/MOGLiCodeCreator/wiki/How-to-validate-MetaInfo-elements%3F) in the [User Guide] (https://github.com/iks-github/MOGLiCodeCreator/wiki/User-Guide)). To each of these definitions, MetaInfos can be added to enrich of the data model. These MetaInfo elements are referenced from the templates of the generator plugins. Depending on the context, a template may have specific demands on the MetaInfos it uses and is otherwise unable to produce valid code. For example, the MetaInfo "JavaType" must be present to generate a valid JavaBean, or, the MetaInfo "dbName" must be present if another MetaInfo with the name "persistent" and the value "true" exists.

In order to validate the data model before the code is actually created, generator plugins allow to define validation rules for MetaInfo elements. These validation rules are read from 'MetaInfo.validation' file located in the plugin input subdirectory of the corresponding generator plugin. For conditional rules, additional condition-files must be defined that are referenced in the rules. For more information see [here] (https://github.com/iks-github/MOGLiCodeCreator/blob/master/filemaker.classbased.velocity/src/main/resources/defaultInputData/VelocityClassBasedFileMaker/MetaInfo.validation).

In case a validation rule is broken, the generator will not create any code and an error report file is created see [Reporting] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Logging-and-Reporting).

In any case, the StandardModelProvider creates the file 'ModelStatistics.txt' with information about the model, about the plugins using the model and about the MetaInfos.


[Back to the overview of Concepts] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Concepts)

Clone this wiki locally