Esempio n. 1
0
        public void computeFeatures()
        {
            this.EOperations = new List <EOperation>();
            this.EAttributes = new List <EAttribute>();
            if (EaElement.Abstract == "1")
            {
                isAbstract = true;
            }
            this.isInterface = EaElement.IsSpec;
            this.Alias       = this.EaElement.Alias;

            foreach (SQLAttribute attribute in this.EaElement.Attributes)
            {
                EAttribute eAttribute = new EAttribute(attribute, Repository);
                eAttribute.computeAttributes();
                this.EAttributes.Add(eAttribute);
            }
            foreach (SQLMethod parameter in this.EaElement.Methods)
            {
                EOperation eOperation = new EOperation(parameter, Repository);
                eOperation.computeAttributes();
                this.EOperations.Add(eOperation);
            }
        }
Esempio n. 2
0
        public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode)
        {
            MocaNode      operationsNode  = actNode.getChildNodeWithName(EClass.OperationsChildNodeName);
            MocaNode      attributesNode  = actNode.getChildNodeWithName(EClass.AttributesChildNodeName);
            MocaAttribute guidAttr        = actNode.getAttributeOrCreate(Main.GuidStringName);
            MocaAttribute nameAttr        = actNode.getAttributeOrCreate("name");
            MocaAttribute aliasAttr       = actNode.getAttributeOrCreate("alias");
            MocaAttribute isAbstractAttr  = actNode.getAttributeOrCreate("isAbstract");
            MocaAttribute isInterfaceAttr = actNode.getAttributeOrCreate("isInterface");

            if (nameAttr != null)
            {
                this.Name = nameAttr.Value;
            }
            if (guidAttr != null)
            {
                this.Guid = guidAttr.Value;
            }
            if (aliasAttr != null)
            {
                this.Alias = aliasAttr.Value;
            }
            if (isAbstractAttr.Value != "")
            {
                if (bool.TryParse(isAbstractAttr.Value, out this.isAbstract))
                {
                }
                else
                {
                    int value = 0;
                    if (int.TryParse(isAbstractAttr.Value, out value))
                    {
                        this.isAbstract = value == 1;
                    }
                }
            }
            if (isInterfaceAttr.Value != "")
            {
                this.isInterface = Boolean.Parse(isInterfaceAttr.Value);
            }

            foreach (MocaNode eOpNode in operationsNode.Children)
            {
                SQLMethod method = findMethodFromMocaNode(this.EaElement, eOpNode);
                if (method != null)
                {
                    EOperation actEOperation = new EOperation(method, Repository);
                    actEOperation.deserializeFromMocaTree(eOpNode);
                    this.EOperations.Add(actEOperation);
                }
            }
            foreach (MocaNode eAttrNode in attributesNode.Children)
            {
                foreach (SQLAttribute attr in this.EaElement.Attributes)
                {
                    if (attr.Name == eAttrNode.getAttributeOrCreate("name").Value)
                    {
                        EAttribute eAttr = new EAttribute(attr, Repository);
                        eAttr.deserializeFromMocaTree(eAttrNode);
                        this.EAttributes.Add(eAttr);
                    }
                }
            }
            isInitialized = true;
        }