private CoreAttribute createAttribute(CoreNamespace ownerNamespace, CoreModelElement owner, XElement xattribute, CoreStereotype coreStereotype) { CoreAttribute coreAttribute = new CoreAttributeImpl(); coreAttribute.setName(xattribute.Attribute("name").Value); coreAttribute.setElemOwner(owner); updateElemOwnedElements(owner, coreAttribute); coreAttribute.setNamespace(ownerNamespace); updateNamespaceElemOwnedElements(ownerNamespace, coreAttribute); //coreAttribute.setOwnerScope(getScopeKind(xattribute.Attribute("ownerScope").Value)); var id = xattribute.Attribute("Id").Value; lookup.Add(id, coreAttribute); var xtype = xattribute.Descendants(xnamespaceUmlModel + "referencedTypeMoniker").FirstOrDefault(); if (xtype != null) { string xidref = xtype.Attribute("Id").Value; idToType.Add(id, xidref); } var isUnique = xattribute.Attribute("isUnique"); if (isUnique == null || isUnique.Value == "true") { updateExtendedElements(coreStereotype, coreAttribute); updateStereotypes(coreAttribute, coreStereotype); } return(coreAttribute); }
private CoreClassifier createEnumeration(XNamespace xnamespace, CoreNamespace ownerNamespace, CoreModelElement owner, XElement xenumeration, CoreStereotype coreStereotype) { CoreClassifier modelClass = new CoreClassifierImpl(); modelClass.setName(xenumeration.Attribute("name").Value); modelClass.setElemOwner(owner); updateElemOwnedElements(owner, modelClass); modelClass.setNamespace(ownerNamespace); updateNamespaceElemOwnedElements(ownerNamespace, modelClass); updateExtendedElements(coreStereotype, modelClass); updateStereotypes(modelClass, coreStereotype); var xattributes = xenumeration.Descendants(xnamespace + "enumerationLiteral"); foreach (var xattribute in xattributes) { CoreAttribute coreAttribute = new CoreAttributeImpl(); coreAttribute.setName(xattribute.Attribute("name").Value); coreAttribute.setElemOwner(modelClass); updateElemOwnedElements(modelClass, coreAttribute); coreAttribute.setNamespace(ownerNamespace); updateNamespaceElemOwnedElements(ownerNamespace, coreAttribute); var id2 = xattribute.Attribute("Id").Value; lookup.Add(id2, coreAttribute); } var id = xenumeration.Attribute("Id").Value; lookup.Add(id, modelClass); return(modelClass); }
private CoreAttribute createAttribute(CoreNamespace ownerNamespace, CoreModelElement owner, XElement xattribute) { CoreAttribute coreAttribute = new CoreAttributeImpl(); coreAttribute.setName(xattribute.Attribute("name").Value); coreAttribute.setElemOwner(owner); updateElemOwnedElements(owner, coreAttribute); coreAttribute.setNamespace(ownerNamespace); updateNamespaceElemOwnedElements(ownerNamespace, coreAttribute); coreAttribute.setOwnerScope(getScopeKind(xattribute.Attribute("ownerScope").Value)); var id = xattribute.Attribute("xmi.id").Value; lookup.Add(id, coreAttribute); string xidref = xattribute.Attribute("type").Value; idToType.Add(id, xidref); return(coreAttribute); }