../../_images/Revised.png

4.4.5. Text files (plain files)

MetaFactory produces several kinds of files:

  • java source code,

  • xml files and

  • plain text files like JavaScript, HTML, JSON, YAML.

The <file> element is the way to create create plain text files.

Usage

Listing 4.41 <text files/> syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<code_instruction>
        ...
        <file>
                name=""
                path=""
                description=""
                writePolicy
                trimLeading=""
                trimTrailing=""
                format=""
                code instruction base

                <body></body>
        </file>
        ...
</code_instruction>

Attributes

Table 4.50 attributes of <text files/>

Name

Details

name

The name of the file made. Mandatory

path

Path where the file is saved.

description

Description of the file. Not used in the produced file.

writePolicy

Generates the source only if the source does not already exist. Values: once|always. Default: allways

trimLeading

true or false. If true, leading spaces are removed.

trimTrailing

true or false. If true, trailing spaces are removed.

format

Question S

code instruction base

Loupe S Code instruction base.

Sub elements

Table 4.51 sub elements of <file/>

Name

Details

Number

body

Content of the file. A snippet can also be used.

0 or 1