.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : MapiRef_ModelReference.rst * Created by : Marnix Bochove (original text) * Last update : 31-03-2021 * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt .. include:: /external-links.txt Model API Model Reference ========================= ModelAttribute is a child of ModelObject and can contain Metadata. All mentioned functions are available on ModelAttribute which is made available in Freemarker/Velocity by iterating over the element tree in model.xml. In any step of the operation process you can access ModelAttribute, which is always the currently active attribute. For an image see :ref:`API_hierarchy` |Eye M| Getter functions in Freemarker/Velocity can be accessed as an object property, so modelReference.getName() can be written as **modelReference.name**. Overview -------- .. list-table:: **API of 'Model Reference'** :widths: 20 80 :header-rows: 1 :class: tight-table * - Modifier and Type - Method and Description * - void - :ref:`addMetaData(String key, String value) ` * - void - :ref:`addMetaData(String key, String value, String description) ` * - List - :ref:`findMetaDataByKey(String expression) ` * - String - :ref:`getFileComment() ` * - String - :ref:`getKind() ` * - Integer - :ref:`getLength() ` * - List - :ref:`getMetaData() ` * - String - :ref:`getMetaData(String metaDataKey) ` * - String - :ref:`getMetaData(String metaDataKey, boolean throwExceptionIfNotFound) ` * - String - :ref:`getMetaData(String metaDataKey, String defaultValue) ` * - String - :ref:`getMultiplicity() ` * - String - :ref:`getName() ` * - Boolean - :ref:`getNotnull() ` * - ModelObject - :ref:`getObject() ` * - String - :ref:`getType() ` * - boolean - :ref:`hasMetaData(String key) ` * - boolean - :ref:`hasMetaData(String key, String value) ` * - void - :ref:`setFileComment(String fileComment) ` * - void - :ref:`setLength(Integer length) ` * - void - :ref:`setMultiplicity() ` * - void - :ref:`setName(String name) ` * - void - :ref:`setNotnull(Boolean notnull) ` * - void - :ref:`setObject(ModelObject object) ` * - void - :ref:`setType(String type) ` Details ------- .. include:: include/addMetaData2.txt .. include:: include/addMetaData3.txt .. include:: include/findMetaDataByKey1.txt .. include:: include/getFileComment.txt .. include:: include/getKind.txt .. include:: include/getLength.txt .. include:: include/getMetaData.txt .. include:: include/getMetaData1.txt .. include:: include/getMetaData1a.txt .. include:: include/getMetaData2.txt getMultiplicity() ~~~~~~~~~~~~~~~~~ .. code-block:: java String getMultiplicity() .. rubric:: Description Returns the Multiplicity value of this reference, which can be “0..1”, “1..1”, “0..n” or “1..1”. .. rubric:: Example none .. include:: include/getName.txt .. include:: include/getNotnull.txt .. include:: include/getObject.txt .. include:: include/getType.txt .. include:: include/hasMetaData1.txt .. include:: include/hasMetaData2.txt .. include:: include/setFileComment1.txt .. include:: include/setLength1.txt setMultiplicity() ~~~~~~~~~~~~~~~~~ .. code-block:: java void setMultiplicity(String multiplicity) .. rubric:: Description Sets the Multiplicity value of this reference, which should be “0..1”, “1..1”, “0..n” or “1..1”. .. rubric:: Example none .. include:: include/setName1.txt .. include:: include/setNotnull1.txt .. include:: include/setObject1.txt .. include:: include/setType1.txt