4.1.2.8. Property Files

<propertyFiles/> is a sub element of <personel-iom-project>.

The purpose of this element is to be able to include files with properties. These properties may be useful to save local resource paths.

Listing 4.9 <propertyFiles/> syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<personal-iom-project xsi:schemaLocation="http://www.firstbase.nl/xsd/personaliom/project
                                                http://www.firstbase.nl/xsd/personaliom/project.xsd"
                                        xmlns="http://www.firstbase.nl/xsd/personaliom/project"
                                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        ...

        <propertyFiles>
                <propertyFile filepath="path/to/property/files" ignoreMissing="false" ></propertyFile>
        </propertyFiles>

        ...

</personel-iom-project>

Potential content of a property file

#path to parent folder
output.path=../parent-path

#path to some library
lib1.path=../../some-shared-library

4.1.2.8.1. Attributes

There are no attributes for <propertyFiles/>.

4.1.2.8.2. Sub elements

Table 4.6 <propertyFiles/> sub elements

Name

Details

Number

propertyFile

Path to the property file

0-n

4.1.2.8.3. Example

<propertyFiles/> in project file shows a project file metafactory.xml that defines a file ‘local.properties’ in the propertyFiles element.

The file local.properties brings some properties that are used in the project together. A programmer can alter these properties for personal use without having to change the project file.

Listing 4.10 <propertyFiles/> in project file
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8"?>
<personal-iom-project xsi:schemaLocation="http://www.firstbase.nl/xsd/personaliom/project
                                                http://www.firstbase.nl/xsd/personaliom/project.xsd"
                                        xmlns="http://www.firstbase.nl/xsd/personaliom/project"
                                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        ...

                <!--Project properties placed in local.properties so these are editable for the programmer.-->
                <propertyFiles>
                        <propertyFile filepath="local.properties"/>
                </propertyFiles>

        ...

</personel-iom-project>

The file local.properties for the example above could contain the following:

#output path used in metafactory.xml to specify path for created java files, xml files and other files
output.path=../test-application    # my test output directory.
#output.path=../hours-administration

The properties defined in the ‘local.properties’ are reachable via the variable project.property. For the output path this would be ${project.property.output.path}