.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : CIX_JCIE_Operation.rst * Created by : Marnix Bochove (original text) * Last update : 18-03-2021 * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt Operation ========= is a child element of or and defines a Java method. .. rubric:: Usage The name attribute is mandatory and indicates the name of the method. Syntax of the operation element: .. code-block:: xml :caption: example :name: operation-01 :linenos: ... ... .. rubric:: Attributes .. list-table:: **attributes of ** :widths: 20 80 :header-rows: 1 :class: tight-table * - Name - Details * - name - The name of the java method made. When you name it “constructor” it will create a constructor. * - visibility - Visibility of the method. Possible values are public, protected en private. If left empty, then private is used. * - static - true or false. Indicates whether or not the method should be defined static. * - abstract - true or false. Indicates whether or not the method should be defined abstract. * - final - true or false. Indicates whether or not the method should be defined final. * - foreach - Indicates if operation must be created foreach element in model (value of foreach determines what model element). Possible values: package, object, attribute, reference * - 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 package 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. * - var0 - Value that you wish to store in the pre-defined variable with the name var0. Reference to this value can be made later by means of: ${var0}. This can be used in both the pattern and in a snippet (freemarker or velocity template). * - var1 - Value that you wish to store in the pre-defined variable with the name var1. Reference to this value can be made later by means of: ${var1}. This can be used in both the pattern and in a snippet (freemarker or velocity template). * - var2 - Value that you wish to store in the pre-defined variable with the name var2. Reference to this value can be made later by means of: ${var2}. This can be used in both the pattern and in a snippet (freemarker or velocity template). * - var3 - Value that you wish to store in the pre-defined variable with the name var3. Reference to this value can be made later by means of: ${var3}. This can be used in both the pattern and in a snippet (freemarker or velocity template). * - var4 - Value that you wish to store in the pre-defined variable with the name var4. Reference to this value can be made later by means of: ${var4}. This can be used in both the pattern and in a snippet (freemarker or velocity template). * - var5 - Value that you wish to store in the pre-defined variable with the name var5. Reference to this value can be made later by means of: ${var5}. This can be used in both the pattern and in a snippet (freemarker or velocity template). .. rubric:: Sub elements .. list-table:: **sub elements of ** :widths: 15 70 15 :header-rows: 1 :class: tight-table * - Name - Details - Number * - :ref:`library ` - The value of library is attached as an *import statement* to the class or interface in which this attribute is defined. - 0 or 1 * - apicomment - Javadoc that is attached to this method. - 0 or 1 * - developercomment - Commentary that is attached to this attribute. - 0 or 1 * - annotation - Annotation defined for the attribute. - 0 or more * - :ref:`parameter ` - Parameter of this method. The parameter with the name 'return is reserved for specifying the return parameter. - 0 or more * - exception - Exception thrown by this method. - 0 or more * - body - The contents of the method. - 0 or 1 .. toctree:: :maxdepth: 1 :caption: Sub element Parameter CIX_JCIE_Parameter