public static void markWithDefaultRealization(ReferenceTreatment referenceTreatment) { TagUtils.addTag(referenceTreatment, WITH_DEFAULT_OBJECT_REALIZATION).setValue("true"); }
private void addInheritedProperties(Structure structure) { if (TagUtils.getTagWithName(structure, TagUtils.DATATYPE_PROCESSED).isPresent()) { return; } TagUtils.addTag(structure, TagUtils.DATATYPE_PROCESSED).setValue("true"); Multimap<String, Feature> inheritedProperties = buildNameToInheritedPropertiesMap(structure); processOverrides(structure, inheritedProperties); for (String inheritedPropertyName : inheritedProperties.keySet()) { LinkedList<Feature> inheritedPropertiesForName = Lists .newLinkedList(inheritedProperties.get(inheritedPropertyName)); Feature newProperty = processInheritedProperty(inheritedPropertiesForName); structure.getOwnedFeatures().add(newProperty); } }
private Consumer<RealizationRule> storeAutoRealization(RealizationContainer container) { return (rule) -> { String templateName = Overlay.of(rule).getPathInParent(); if (templateName != null) { Extension tag = TagUtils.addTag(container, TagUtils.REALIZATION_TEMPLATE_NAME); tag.setValue(templateName); } }; }
public ReferenceRealization buildReferenceRealization(final EffectiveRealization realization) { final ReferenceRealization referenceRealization = this.rapidmlFactory.createReferenceRealization(); referenceRealization.setRealizationType(ReferenceRealizationEnum.EMBED); referenceRealization.setEffectiveRealization(realization); referenceRealization.setDataType(realization.getType()); boolean _isEmpty = realization.getLinks().isEmpty(); boolean _not = (!_isEmpty); if (_not) { referenceRealization.setRealizationType(ReferenceRealizationEnum.LINK); final Map.Entry<String, ServiceDataResource> linkInfo = ((Map.Entry<String, ServiceDataResource>[])Conversions.unwrapArray(realization.getLinks().entrySet(), Map.Entry.class))[0]; referenceRealization.setTargetResource(linkInfo.getValue()); final Extension tag = TagUtils.addTag(referenceRealization, TagUtils.LINK_RELATION); tag.setValue(linkInfo.getKey()); } return referenceRealization; } }
public void addInheritedProperties(ZenModel model) { if (model == null) { // can be null when an import declaration is declared, but elements from it are never used return; } if (TagUtils.getTagWithName(model, TagUtils.DATATYPE_PROCESSED).isPresent()) { return; } TagUtils.addTag(model, TagUtils.DATATYPE_PROCESSED).setValue("true"); for (Structure structure : EcoreUtil2.getAllContentsOfType(model, Structure.class)) { addInheritedProperties(structure); } for (ImportDeclaration import_: model.getImports()) { addInheritedProperties(import_.getImportedModel()); } }
TagUtils.addTag(newProperty, PROPERTY_INHERITED).setValue("true");