guard

Syntax

[#guard condition]

where:

Description

The guard directive conditionally skips the evaluation of a text template or of a script body.

If the guard fails (the condition evaluate to false), the body of the text template or of the script is ignored and an empty string is returned. In case of a text template using a file directive, the generated file is not written on disk.

Examples

This script returns an empty string if the UML class is not abstract:

[#script abstractClassDeclaration]
[#guard self.isAbstract]
This class is abstract.
[/#script]