Note
The documentation in chapter 4.1 and subsequent sections is based on XML Schemas that are to be updated in due time.
5.1. Project Reference
Every MetaFactory project requires a project configuration file, which can be in XML format (recommended) or YAML. The other 2 required components in a project are the model and the patterns (code instructions). This document describes the required structure of the XML-version (named metafactory.xml) of the file and its child elements.
Metafactory.xml describes where MetaFactory determines the location of its source files as well as the ones that will be generated.
5.1.1. Structure of the project file
Listing 5.1 shows a metafactory.xml project file with its root element <personel-iom-project>. In metafactory.xml at least one and a maximum of three of these elements should be present.
1<personal-iom-project>
2 <model>src/model/model.xml</model>
3 <pattern>src/pattern/pattern.xml</pattern>
4 <snippetsFolder>src/snippets</snippetsFolder>
5 <output>
6 <path type="java">src/java</path>
7 <path type="xml">xml/files/go/here</path>
8 <path type="file">other/files/go/inhere</path>
9 </output>
10 ...
11 <buildSets>
12 <buildSet name="myBuildSet01"></buildSet>
13 <buildSet name="myBuildSet02"></buildSet>
14 <buildSet name="js only">
15 <file name="*.js"/>
16 </buildSet>
17 ...
18 </buildSets>
19 ...
20 <businessStyle>
21 ...
22 </businessStyle>
23 ...
24 <maps>
25 1 or more
26 <map name="myMapName01"></map>
27 <map name="myMapName02">
28 <entry key="Integer" value="number" />
29 <entry key="String" value="string" />
30 ...
31 </map>
32 ...
33 </maps>
34 ...
35 <propertyFiles>
36 <propertyFile filepath="path/to/property/files" ignoreMissing="false" ></propertyFile>
37 </propertyFiles>
38 ...
39</personel-iom-project>
Optionally you can also define your own generation schemes here which allow you to only generate a subset of the files, which can be defined by using ‘buildSet’ properties.
Name |
Details |
---|---|
allowDeprecated |
Use: optional, Default: true |
Sub elements
The following elements can be defined from inside the <personel-iom-project/> element.
Name |
Details |
Number |
---|---|---|
model |
This element marks the location of model.xml, which is where all project data will be located See Project file example line 6 |
1 |
pattern (code_instruction) |
This element marks the location of the main pattern file, which is usually named ‘pattern.xml’. See Project file example line 7 |
1 |
snippetsFolder |
This element marks the location of the project’s pattern snippets. 0 or 1 See Project file example line 8 |
1 |
output |
This element marks the location of the project’s output folder. For the possible output options for the three file types see Project file example line 9-13 |
0 or 1 |
buildSets |
buildSets group individual buildSet elements. MetaFactory uses buildSets to define themed groups of files that enable partial generation of the project. See Project file example lines 15-22 |
0 or 1 |
maps |
The maps group the map elements. 0 or 1 A map element is used to alter the mapping of the build-in type sets javaTypes and hibernateTypes. |
0 or 1 |
propertyFiles |
The purpose of this element is to be able to include files with properties. |
0 or 1 |
configuration |
0 or 1 |
|
businessStyle |
Used for the JavaDoc |
0 or 1 |