.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : FM_Metafacory.rst * Created by : Marnix Bochove (original text) * Last update : 06-04-2021 * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt .. include:: /external-links.txt Freemarker context object: metafactory ====================================== With the context object “metafactory” all the methods from a template engine can be called. .. rubric:: Method Summary .. list-table:: **All Methods: Instance Methods and Abstract Methods** :widths: 20 30 50 :header-rows: 1 :class: tight-table * - Modifier and Type - Method - Description * - void - addAttribute(IXMIAttribute sxmiAttribute) - * - void - addAttribute(IXMIInterface sxmiInterface, IXMIAttribute sxmiAttribute) - * - void - addAttributeToClass(IXMIAttribute sxmiAttribute) - * - void - addAttributeToInterface(IXMIAttribute sxmiAttribute) - * - void - addLibrary(IXMIClass sxmiClass, String library) - * - void - addLibrary(String library) - * - void - addLibraryToClass(String library) - * - void - addLibraryToInterface(String library) - * - void - addOperation(IXMIClass sxmiClass, IXMIOperation sxmiOperation) - * - void - addProperty(org.jdom2.Element element, String propertyName) - * - void - addProperty(org.jdom2.Element element, String propertyName, int propertyValue, org.jdom2.Namespace namespace) - * - void - addProperty(org.jdom2.Element element, String propertyName, String propertyValue) - * - List - createEmptyList() -  Create an empty Freemarker list. * - Map - createEmptyMap() - Create an empty Freemarker map. * - boolean - elementContainsProperty(org.jdom2.Element element, String propertyName) - Check if a property *propertyName* exist in the *element* of the pattern or model. * - boolean - elementContainsProperty(org.jdom2.Element element, String propertyName, String propertyValue) - Check if a property *propertyName* exist in the *element* of the pattern or model. If the property is not found the returned value will be *propertyValue* * - void - error(String message) - * - String - evaluateFreeMarkerSnippet(String snippetName) - * - String - evaluateFreeMarkerSnippet(String snippetName, String defaultContent) - * - org.jdom2.Element - findChildByAttribute(org.jdom2.Element parent, String type, String attributeName, String attributeValue) - * - org.jdom2.Element - findChildByProperty(org.jdom2.Element parent, String type, String propertyName) - * - org.jdom2.Element - findChildByProperty(org.jdom2.Element parent, String type, String propertyName, String propertyValue) - * - List - findChildrenByAttribute(org.jdom2.Element parent, String type, String attributeName, String attributeValue) - * - List - findChildrenByProperty(org.jdom2.Element parent, String type, String propertyName) - * - List - findChildrenByProperty(org.jdom2.Element parent, String type, String propertyName, String propertyValue) - * - List - getChildrenWith(org.jdom2.Element parentElement, String childType, String selectorType, String selectorName, String value) - * - String - getElementProperty(org.jdom2.Element element, String propertyName) -  Check if property *propertyName* exist in the *element* of the pattern or model. If the property exist the value is returned, if not found an error occurs. * - String - getElementProperty(org.jdom2.Element element, String propertyName, String defaultValue) - Check if a property *propertyName* exist in the *element* of the pattern or model. If the property exist the value is returned, if not found the property is added and get the value defaultValue * - int - getElementPropertyAsInt(org.jdom2.Element element, String propertyName, int defaultValue) - Check if property *propertyName* exist in the *element* of the pattern or model. If the property exist the value is returned as an Integer value. If  not found the property is added  and get the integer value *defaultValue* * - List - getModelAttributesWithProperty(String propertyName) - A list of all the attribute in the model which object attributes have a property *propertyName* * - List - getModelAttributesWithProperty(String propertyName, String propertyValue) - A list of all the attribute in the model which object attributes have a property *propertyName* and the specific value  *propertyValue* * - org.jdom2.Element - getModelAttributeWithProperty(String propertyName) - * - org.jdom2.Element - getModelAttributeWithProperty(String propertyName, String propertyValue) - * - String - getModelObjectPropertyValue(String objectName, String key) - * - List - getModelObjectsWithProperty(String propertyName) - A list of all the objects in the model which object  have a property propertyName * - List - getModelObjectsWithProperty(String propertyName, String propertyValue) - A list of all the objects in the model which object have a property *propertyName* and the specific value  *propertyValue* * - List - getModelOperationsWithProperty(String propertyName) - * - List - getModelOperationsWithProperty(String propertyName, String propertyValue) - * - List - getModelPackagesWithProperty(String propertyName) - * - List - getModelPackagesWithProperty(String propertyName, String propertyValue) - * - List - getModelReferencesWithProperty(String propertyName) - A list of all the references in the model which object references have a property *propertyName* * - List - getModelReferencesWithProperty(String propertyName, String propertyValue) - A list of all the references in the model which object references have a property *propertyName* and the specific value  *propertyValue* * - org.jdom2.Element - getModelReferenceWithProperty(String propertyName) - * - org.jdom2.Element - getModelReferenceWithProperty(String propertyName, String propertyValue) - * - List - getPropertyElements(org.jdom2.Element element, String propertyName) - * - boolean - isModelChanged() - * - void - IXMIOperation sxmiOperation) - * - void - log(String message) - .. list-table:: **All Methods Instance Methods Abstract Methods** :widths: 10 30 :header-rows: 1 :class: tight-table * - Modifier and Type - Method and Description * - String - allLower(String variable) * - String - allUpper(String variable) * - List - asList(Object[] someArray) * - String - camelToAllUpperUnderscore(String variable) * - String - decapitalize(String var, String sLength) * - String - evaluateExpression(String key) * - String - evaluateSnippet(String snippetName,String defaultContent) * - String - firstLower(String variable) * - String - firstToken(String expression, String token) * - String - firstUpper(String variable) * - String - getAttributeType(String objectname, String associationPath) * - String - getHibernateType(String sxmiType) * - String - getJavaType(String sxmiType) * - String - getJavaWrapperClass(String sxmiType) * - org.jdom2.Element - getLastElementFromAssociationPath(String associationPath, org.jdom2.Element parentObjectElement) * - String - getReferenceType(String objectname, String associationPath) * - String - getSetterName(String referenceType, String modelObjectName) * - String - getTokenByIndex(String expression, String token, int tokenNumber) * - String - getTokenByIndex(String expression, String token, String tokenNumberString) * - String - getValue(String[] arguments) * - String - getValueFromMap(String mapName, String key) * - boolean - isPrimitiveJavaType(String sxmiType) * - String - lastToken(String expression, String token) * - String - lastToken(String[] arguments) * - String - length(String variable) * - String - packageToPath(String packageName) * - List - sort(List list, Comparator comparator) .. list-table:: **All Methods Instance Methods Abstract Methods Deprecated** :widths: 10 30 :header-rows: 1 :class: tight-table * - String - evaluateExpression(String key) * - String - evaluateExpression(String key, IContextProxy context) |Cross S| Deprecated * - String - evaluateExpression(String key, IContextProxy context, String defaultValue) |Cross S| Deprecated * - String - evaluateExpression(String key, String defaultValue) * - String - evaluateFreeMarkerSnippet(String snippetName) * - String - evaluateFreeMarkerSnippet(String snippetName, String defaultContent) * - String - evaluateSnippet(String snippetName) * - String - evaluateSnippet(String snippetName, IContextProxy context, String defaultContent) |Cross S| Deprecated * - String - evaluateSnippet(String snippetName, String defaultContent)