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

Attributes

Table 5.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 5.51 sub elements of <file/>

Name

Details

Number

body

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

0 or 1