Note

Hammer M Update in the near future.

The documentation in chapter 4.1 and subsequent sections is based on XML Schemas that are to be updated in due time.

4.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.

4.1.1. Structure of the project file

Listing 4.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.

Listing 4.1 Project file example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<personal-iom-project>
        <model>src/model/model.xml</model>
        <pattern>src/pattern/pattern.xml</pattern>
        <snippetsFolder>src/snippets</snippetsFolder>
        <output>
                <path type="java">src/java</path>
                <path type="xml">xml/files/go/here</path>
                <path type="file">other/files/go/inhere</path>
        </output>
        ...
        <buildSets>
                <buildSet name="myBuildSet01"></buildSet>
                <buildSet name="myBuildSet02"></buildSet>
                <buildSet name="js only">
                        <file name="*.js"/>
                </buildSet>
                ...
        </buildSets>
        ...
        <businessStyle>
                ...
        </businessStyle>
        ...
        <maps>
                1 or more
                <map name="myMapName01"></map>
                <map name="myMapName02">
                        <entry key="Integer" value="number" />
                        <entry key="String" value="string" />
                        ...
                </map>
                ...
        </maps>
        ...
        <propertyFiles>
                <propertyFile filepath="path/to/property/files" ignoreMissing="false" ></propertyFile>
        </propertyFiles>
  ...
</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.

Table 4.1 <personel-iom-project/> attributes>

Name

Details

allowDeprecated

Use: optional, Default: true

Sub elements

The following elements can be defined from inside the <personel-iom-project/> element.

Table 4.2 <personel-iom-project/> sub elements

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

Question S

0 or 1

businessStyle

Used for the JavaDoc

0 or 1