예제 #1
0
        private void createAssociationEnd(XNamespace xnamespace, CoreAssociation coreAssociation, XElement xassociationend)
        {
            CoreAssociationEnd coreAssociationEnd = new CoreAssociationEndImpl();

            coreAssociationEnd.setName(xassociationend.Attribute("name").Value);

            coreAssociationEnd.setAssociation(coreAssociation);
            coreAssociationEnd.setOrdering(getOrderingKind(xassociationend.Attribute("ordering").Value));

            updateConnection(coreAssociation, coreAssociationEnd);

            var xqualifiernamespace = xassociationend.Element(xnamespace + "AssociationEnd.qualifier");

            if (xqualifiernamespace != null)
            {
                var xqualifiers = xqualifiernamespace.Elements(xnamespace + "Attribute");
                foreach (var xqualifier in xqualifiers)
                {
                    CoreAttribute qualifier = createAttribute(null, coreAssociationEnd, xqualifier);
                    updateQualifiers(coreAssociationEnd, qualifier);
                }
            }

            var multiplicity = createMultiplicity(xnamespace, xassociationend);

            coreAssociationEnd.setMultiplicity(multiplicity);

            var id = xassociationend.Attribute("xmi.id").Value;

            lookup.Add(id, coreAssociationEnd);
            var xtyperefid = xassociationend.Attribute("type").Value;

            idToType.Add(id, xtyperefid);
        }
예제 #2
0
        private CoreAssociationEnd createAssociationEnd(XNamespace xnamespace, CoreAssociation coreAssociation, XElement xassociationend)
        {
            CoreAssociationEnd coreAssociationEnd = new CoreAssociationEndImpl();
            var name = xassociationend.Attribute("name");

            coreAssociationEnd.setName(name != null ? name.Value : "");

            coreAssociationEnd.setAssociation(coreAssociation);
            //coreAssociationEnd.setOrdering(getOrderingKind(xassociationend.Attribute("ordering").Value));

            updateConnection(coreAssociation, coreAssociationEnd);

            //var xqualifiernamespace = xassociationend.Element(xnamespace + "AssociationEnd.qualifier");
            //if (xqualifiernamespace != null)
            //{
            //    var xqualifiers = xqualifiernamespace.Elements(xnamespace + "Attribute");
            //    foreach (var xqualifier in xqualifiers)
            //    {
            //        CoreAttribute qualifier = createAttribute(null, coreAssociationEnd, xqualifier);
            //        updateQualifiers(coreAssociationEnd, qualifier);
            //    }
            //}

            var multiplicity = createMultiplicity(xnamespace, xassociationend);

            coreAssociationEnd.setMultiplicity(multiplicity);

            var id = xassociationend.Attribute("Id").Value;

            lookup.Add(id, coreAssociationEnd);

            return(coreAssociationEnd);
        }