.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : CIX_JCIE_Library.rst * Created by : Marnix Bochove (original text) * Last update : 18-03-2021 * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt Library ======= Using is the way to add **import statements** to a Java Class or Interface. Inside a pattern this element can be a child of or . Defining imports on an operation (or attribute) rather than the parent class has the advantage that the import lines are only added when that operation is actually generated, and not when the condition attribute of the operation returns false. Zero or more library elements can be used. .. rubric:: Usage .. code-block:: xml :caption: Syntax :name: library-01 :linenos: some.class.tobe.imported .. rubric:: Attributes .. list-table:: **attributes of ** :widths: 20 80 :header-rows: 1 :class: tight-table * - Name - Details * - foreach - Indicates whether the interface must be created for each element in model (value of foreach determines what model element). Possible values: package, object. * - condition - An expression that evaluates to true or false. Generation of the current file wil precede if true and otherwise not. Example: .. code-block:: condition="${object.name}=Person" In this case, the library is generated only if the current model object has the name: Person. This works only if all model objects are iterated (foreach=”object”). * - package - The name of the package in the model (model.xml) that must be used to apply the foreach attribute. * - object - The name of the object in the model (model.xml) that must be used to apply the foreach attribute.