예제 #1
0
        private CoreOperation createOperation(XNamespace xnamespace, CoreNamespace ownerNamespace, CoreModelElement owner, XElement xoperation)
        {
            CoreOperation coreOperation = new CoreOperationImpl();

            coreOperation.setName(xoperation.Attribute("name").Value);
            coreOperation.setElemOwner(owner);
            updateElemOwnedElements(owner, coreOperation);
            coreOperation.setNamespace(ownerNamespace);
            updateNamespaceElemOwnedElements(ownerNamespace, coreOperation);

            coreOperation.setOwnerScope(getScopeKind(xoperation.Attribute("ownerScope").Value));

            var xbehavioralFeature = xoperation.Element(xnamespace + "BehavioralFeature.parameter");

            if (xbehavioralFeature != null)
            {
                var xparameters = xbehavioralFeature.Elements(xnamespace + "Parameter");
                foreach (var xparameter in xparameters)
                {
                    createParameter(xnamespace, ownerNamespace, coreOperation, xparameter);
                }
            }

            var isQuery = xoperation.Attribute("isQuery").Value;

            coreOperation.setIsQuery(bool.Parse(isQuery));

            lookup.Add(xoperation.Attribute("xmi.id").Value, coreOperation);

            return(coreOperation);
        }
예제 #2
0
        private CoreOperation createOperation(XNamespace xnamespace, CoreNamespace ownerNamespace, CoreModelElement owner, XElement xoperation)
        {
            CoreOperation coreOperation = new CoreOperationImpl();

            coreOperation.setName(xoperation.Attribute("name").Value);
            coreOperation.setElemOwner(owner);
            updateElemOwnedElements(owner, coreOperation);
            coreOperation.setNamespace(ownerNamespace);
            updateNamespaceElemOwnedElements(ownerNamespace, coreOperation);

            //coreOperation.setOwnerScope(getScopeKind(xoperation.Attribute("ownerScope").Value));

            var xparameters = xoperation.Descendants(xnamespace + "parameter");

            foreach (var xparameter in xparameters)
            {
                createParameter(xnamespace, ownerNamespace, coreOperation, xparameter);
            }

            var isQuery = xoperation.Attribute("isQuery").Value;

            coreOperation.setIsQuery(bool.Parse(isQuery));

            lookup.Add(xoperation.Attribute("Id").Value, coreOperation);

            return(coreOperation);
        }