public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { MocaNode constExpNode = actNode.getChildNodeWithName("constraintExpression"); this.ConstraintExpression = Expression.createExpression(constExpNode.getAttributeOrCreate("type").Value, Repository) as ComparisonExpression; this.ConstraintExpression.deserializeFromMocaTree(constExpNode); }
public override Serialization.MocaTree.MocaNode serializeToMocaTree(Serialization.MocaTree.MocaNode actNode) { actNode.appendChildAttribute("name", this.Name); actNode.appendChildAttribute("value", this.Value); actNode.appendChildAttribute("literal", this.Literal); return(actNode); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.MethodGuid = actNode.getAttributeOrCreate("methodGuid").Value; this.MethodNameOld = actNode.getAttributeOrCreate("methodName").Value; this.MethodReturnType = actNode.getAttributeOrCreate("methodReturnType").Value; SQLMethod mt = Repository.GetMethodByGuid(this.MethodGuid); if (mt != null) { this.MethodName = mt.Name; } else { this.MethodName = MethodNameOld; } MocaNode targetNode = actNode.getChildNodeWithName("target"); this.Target = Expression.createExpression(targetNode.getAttributeOrCreate("type").Value, Repository); this.Target.deserializeFromMocaTree(targetNode); foreach (MocaNode childNode in actNode.Children) { if (childNode.Name == "ownedParameterBinding") { ParameterBinding paramBinding = new ParameterBinding(Repository); paramBinding.deserializeFromMocaTree(childNode); this.OwnedParameterBinding.Add(paramBinding); } } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.Guid = actNode.getAttributeOrCreate(Main.GuidStringName).Value; this.typeGuid = actNode.getAttributeOrCreate("typeGuid").Value; this.parameterType = actNode.getAttributeOrCreate("type").Value; this.Name = actNode.getAttributeOrCreate("name").Value; }
private bool tryOldDeserialize(Serialization.MocaTree.MocaNode actNode) { MocaNode adornmentsNode = actNode.getChildNodeWithName("allowedAddornments"); MocaNode modelgenAdornmentsNode = actNode.getChildNodeWithName("modelgenAdornments"); MocaNode parameterInformationNode = actNode.getChildNodeWithName("parameterInformation"); MocaNode parameterTypesNode = actNode.getChildNodeWithName("parameterTypes"); addNodeChildrenToList(adornmentsNode, adornments); addNodeChildrenToList(modelgenAdornmentsNode, modelgenAdornments); addNodeChildrenToList(parameterInformationNode, SignatureInformation); addNodeChildrenToList(parameterTypesNode, Signature); this.informationText = actNode.getAttributeOrCreate("constraintInformation").Value; if (this.informationText.Contains("\r\n")) { String[] splitted = this.informationText.Split("\r\n".ToCharArray()); this.informationText = splitted[splitted.Length - 1]; } this.UserDefined = actNode.getAttributeOrCreate("userDefined").Value == "true"; this.Name = actNode.getAttributeOrCreate("name").Value; MocaAttribute indexAttr = actNode.getAttributeOrCreate("index"); if (indexAttr.Value != "") { this.Index = int.Parse(indexAttr.Value); } return(true); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { MocaAttribute guidAttr = actNode.getAttributeOrCreate(Main.GuidStringName); MocaAttribute typeGuidAttr = actNode.getAttributeOrCreate("typeGuid"); this.typeGuid = typeGuidAttr.Value; this.guid = actNode.getAttributeOrCreate(Main.GuidStringName).Value; this.returnType = actNode.getAttributeOrCreate("returnType").Value; this.Name = actNode.getAttributeOrCreate("name").Value; MocaNode parametersNode = actNode.getChildNodeWithName(EOperation.ParametersChildNodeName); foreach (MocaNode eParamNode in parametersNode.Children) { if (eParamNode.Name == "EParameter") { foreach (SQLParameter neededParam in this.EaMethod.Parameters) { if (neededParam.Name == eParamNode.getAttributeOrCreate("name").Value) { EParameter eParam = new EParameter(neededParam, Repository); eParam.deserializeFromMocaTree(eParamNode); this.EParameters.Add(eParam); } } } } //only for import purposes }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { base.deserializeFromMocaTree(actNode); MocaNode domainsNode = actNode.getChildNodeWithName("domains"); MocaNode metamodelsNode = actNode.getChildNodeWithName("metamodels"); Name = EaPackage.Name; if (metamodelsNode != null) { foreach (MocaNode mmNode in metamodelsNode.Children) { Metamodel mm = new Metamodel(); mm.deserializeFromMocaTree(mmNode); this.Metamodels.Add(mm); } } if (domainsNode != null) { foreach (MocaNode dNode in domainsNode.Children) { Domain mm = new Domain(); mm.deserializeFromMocaTree(dNode); this.Domains.Add(mm); } } loadCSPConstraints(actNode); }
internal virtual void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.Name = actNode.getAttributeOrCreate(MoflonCustomNameTaggedValueName).Value; this.NsURI = actNode.getAttributeOrCreate(MoflonCustomNsUriTaggedValueName).Value; this.NsPrefix = actNode.getAttributeOrCreate(MoflonCustomNsPrefixTaggedValueName).Value; package.Name = this.Name; }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { MocaAttribute valueAttribute = actNode.getAttributeOrCreate("value"); MocaAttribute datatypeAttribute = actNode.getAttributeOrCreate("datatype"); this.Value = valueAttribute.Value; this.Datatype = datatypeAttribute.Value; }
override internal void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { base.deserializeFromMocaTree(actNode); this.Validated = actNode.getAttributeOrCreate(MoflonValidatedTaggedValueName).Value == "true"; this.ExportPackage = actNode.getAttributeOrCreate(MoflonExportTaggedValueName).Value == "true"; this.WorkingSetName = actNode.getAttributeOrCreate(MoflonWorkingSetTaggedValueName).Value; this.pluginID = actNode.getAttributeOrCreate(MoflonCustomPluginIDTaggedValueName).Value; }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { MocaNode valueExpressionNode = actNode.getChildNodeWithName("valueExpression"); this.ValueExpression = Expression.createExpression(valueExpressionNode.getAttributeOrCreate("type").Value, Repository); this.ValueExpression.deserializeFromMocaTree(valueExpressionNode); this.ParameterGuid = actNode.getAttributeOrCreate("parameterGuid").Value; this.ParameterType = actNode.getAttributeOrCreate("parameterType").Value; }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { constraintName = actNode.getAttributeOrCreate("constraintName").Value; foreach (MocaNode exprNode in actNode.getChildNodeWithName("expressions").Children) { Expression expression = Expression.createExpression(exprNode.getAttributeOrCreate("type").Value, Repository); expression.deserializeFromMocaTree(exprNode); typedInExpressions.Add(expression); } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.Operator = (ComparingOperator)Enum.Parse(typeof(ComparingOperator), actNode.getAttributeOrCreate("operator").Value.ToUpper()); MocaNode leftNode = actNode.getChildNodeWithName("leftExpression"); this.LeftExpression = Expression.createExpression(leftNode.getAttributeOrCreate("type").Value, Repository); this.LeftExpression.deserializeFromMocaTree(leftNode); MocaNode rightNode = actNode.getChildNodeWithName("rightExpression"); this.RightExpression = Expression.createExpression(rightNode.getAttributeOrCreate("type").Value, Repository); this.RightExpression.deserializeFromMocaTree(rightNode); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.ParameterGUID = actNode.getAttributeOrCreate("parameterGuid").Value; this.ParameterNameOld = actNode.getAttributeOrCreate("parameterName").Value; this.ParameterName = this.ParameterNameOld; SQLParameter param = Repository.GetParameterByGuid(this.ParameterGUID); if (param != null) { this.ParameterName = param.Name; } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.ObjectVariableGUID = actNode.getAttributeOrCreate("objectVariableGuid").Value; this.ObjectVariableNameOld = actNode.getAttributeOrCreate("objectVariableName").Value; this.ObjectVariableName = this.ObjectVariableNameOld; SQLElement ob = Repository.GetElementByGuid(this.ObjectVariableGUID); if (ob != null) { this.ObjectVariableName = ob.Name; } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.linkDialogueEntry = new LinkDialogueEntry(); if (actNode.getAttributeOrCreate(ObjectVariable.NacIndexTaggedValueName).Value != "") { this.NacIndex = int.Parse(actNode.getAttributeOrCreate(ObjectVariable.NacIndexTaggedValueName).Value); } this.BindingOperator = (BindingOperator)Enum.Parse(typeof(BindingOperator), actNode.getAttributeOrCreate("bindingOperator").Value.ToUpper()); this.BindingSemantics = (BindingSemantics)Enum.Parse(typeof(BindingSemantics), actNode.getAttributeOrCreate("bindingSemantics").Value.ToUpper()); if (actNode.getAttributeOrCreate("targetGuid") != null) { this.TargetGuid = actNode.getAttributeOrCreate("targetGuid").Value; } if (actNode.getAttributeOrCreate("sourceGuid") != null) { this.SourceGuid = actNode.getAttributeOrCreate("sourceGuid").Value; } this.linkDialogueEntry.supplierRoleName = actNode.getAttributeOrCreate("name").Value; if (actNode.getAttributeOrCreate("sourceName") != null) { this.linkDialogueEntry.clientRoleName = actNode.getAttributeOrCreate("sourceName").Value; } if (linkDialogueEntry.clientRoleName == "" && LinkVariableEA.ClientEnd.Role != "") { linkDialogueEntry.clientRoleName = LinkVariableEA.ClientEnd.Role; } Guid = actNode.getAttributeOrCreate(Main.GuidStringName).Value; if (actNode.getAttributeOrCreate("direction").Value != "") { try { this.linkDialogueEntry.direction = (LinkDialogueEntryDirection)Enum.Parse(typeof(LinkDialogueEntryDirection), actNode.getAttributeOrCreate("direction").Value.ToUpper()); } catch { } } if (actNode.getAttributeOrCreate("textOfReference") != null) { this.linkDialogueEntry.output = actNode.getAttributeOrCreate("textOfReference").Value; } if (actNode.getAttributeOrCreate("textOfReferenceOpposite") != null) { this.linkDialogueEntry.OutputOpposite = actNode.getAttributeOrCreate("textOfReferenceOpposite").Value; } if (actNode.getAttributeOrCreate("idOfReference") != null) { this.linkDialogueEntry.CorrespondingConnectorGuid = actNode.getAttributeOrCreate("idOfReference").Value; } }
public override Serialization.MocaTree.MocaNode serializeToMocaTree(Serialization.MocaTree.MocaNode actNode) { actNode.appendChildAttribute("constraintName", constraintName); MocaNode exprNode = actNode.appendChildNode("expressions"); foreach (Expression expr in typedInExpressions) { MocaNode expressionNode = exprNode.appendChildNode("Expression"); expr.serializeToMocaTree(expressionNode); } return(actNode); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { MocaNode entriesNode = actNode.getChildNodeWithName("entries"); if (entriesNode != null) { foreach (MocaNode entryNode in entriesNode.Children) { CSPInstanceEntry entry = new CSPInstanceEntry(Repository); entry.deserializeFromMocaTree(entryNode); createdEntries.Add(entry); } } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { base.deserializeFromMocaTree(actNode); MocaNode statement = actNode.getChildNodeWithName("statementExpression"); if (statement != null) { MocaAttribute typeAttribute = statement.getAttributeOrCreate("type"); if (typeAttribute != null) { this.StatementExpression = Expression.createExpression(typeAttribute.Value, this.Repository); this.StatementExpression.deserializeFromMocaTree(statement); } } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { setOvName(actNode); setOvGuid(actNode); this.AttributeGUID = actNode.getAttributeOrCreate("attributeGuid").Value; this.AttributeNameOld = actNode.getAttributeOrCreate("attributeName").Value; this.AttributeName = this.AttributeNameOld; MocaNode valueExpressionNode = actNode.getChildNodeWithName("valueExpression"); this.ValueExpression = Expression.createExpression(valueExpressionNode.getAttributeOrCreate("type").Value, Repository); this.ValueExpression.deserializeFromMocaTree(valueExpressionNode); SQLAttribute attribute = Repository.GetAttributeByGuid(this.AttributeGUID); if (attribute != null) { this.AttributeName = attribute.Name; } }
public override Serialization.MocaTree.MocaNode serializeToMocaTree(Serialization.MocaTree.MocaNode actNode) { actNode.Name = this.Name; MocaNode adornmentsNode = actNode.appendChildNode(allowedAdornmentsNodeName); MocaNode modelgenAdornmentsNode = actNode.appendChildNode(modelgenAdornmentsNodeName); MocaNode signatureNode = actNode.appendChildNode(signatureNodeName); MocaNode signatureInformationNode = actNode.appendChildNode(signatureInformationNodeName); addListEntriesToNode(adornments, adornmentsNode); addListEntriesToNode(modelgenAdornments, modelgenAdornmentsNode); addListEntriesToNode(Signature, signatureNode); addListEntriesToNode(SignatureInformation, signatureInformationNode); actNode.appendChildAttribute(informationTextNodeName, this.informationText); actNode.appendChildAttribute(userDefinedNodeName, this.UserDefined.ToString().ToLower()); actNode.appendChildAttribute(indexNodeName, this.Index.ToString()); return(actNode); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { base.deserializeFromMocaTree(actNode); MocaNode returnValueNode = actNode.getChildNodeWithName("returnValue"); if (returnValueNode != null) { MocaAttribute typeAttribute = returnValueNode.getAttributeOrCreate("type"); Expression returnValueExpression = Expression.createExpression(typeAttribute.Value, this.Repository); if (returnValueExpression != null) { returnValueExpression.deserializeFromMocaTree(returnValueNode); } else { } this.ReturnValue = returnValueExpression; } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.Name = actNode.getAttributeOrCreate("name").Value; this.Guid = actNode.getAttributeOrCreate(Main.GuidStringName).Value; MocaNode literalsNode = actNode.getChildNodeWithName("literals"); foreach (MocaNode literalNode in literalsNode.Children) { foreach (SQLAttribute litAttr in this.eaEEnumElement.Attributes) { if (litAttr.Name == literalNode.getAttributeOrCreate("name").Value) { EEnumLiteral eenumLit = new EEnumLiteral(litAttr, Repository); eenumLit.deserializeFromMocaTree(literalNode); removeExisting(litAttr.Name); this.Literals.Add(eenumLit); } } } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { //for old moca trees tryOldDeserialize(actNode); MocaNode adornmentsNode = actNode.getChildNodeWithName(allowedAdornmentsNodeName); MocaNode modelgenAdornmentsNode = actNode.getChildNodeWithName(modelgenAdornmentsNodeName); MocaNode signatureNode = actNode.getChildNodeWithName(signatureNodeName); MocaNode signatureInformationNode = actNode.getChildNodeWithName(signatureInformationNodeName); addNodeChildrenToList(adornmentsNode, adornments); addNodeChildrenToList(modelgenAdornmentsNode, modelgenAdornments); addNodeChildrenToList(signatureNode, Signature); addNodeChildrenToList(signatureInformationNode, SignatureInformation); String infoValue = actNode.getAttributeOrCreate(informationTextNodeName).Value; if (infoValue != "") { this.informationText = infoValue; } String userDefinedValue = actNode.getAttributeOrCreate(userDefinedNodeName).Value; if (userDefinedValue != "") { this.UserDefined = userDefinedValue == "true"; } if (actNode.Name != "CSPConstraint") { this.Name = actNode.Name; } MocaAttribute indexAttr = actNode.getAttributeOrCreate(indexNodeName); if (indexAttr.Value != "") { this.Index = int.Parse(indexAttr.Value); } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.Constraints.Clear(); this.AttributeAssignments.Clear(); this.BindingSemantics = SDMUtil.computeBindingSemantics(actNode.getAttributeOrCreate(ObjectVariable.BindingSemanticsTaggedValueName).Value.ToUpper()); this.BindingOperator = SDMUtil.computeBindingOperator(actNode.getAttributeOrCreate(ObjectVariable.BindingOperatorTaggedValueName).Value.ToUpper()); if (actNode.getAttributeOrCreate(NacIndexTaggedValueName).Value != "") { NacIndex = int.Parse(actNode.getAttributeOrCreate(NacIndexTaggedValueName).Value); } this.BindingState = SDMUtil.computeBindingState(actNode.getAttributeOrCreate(ObjectVariable.BindingStateTaggedValueName).Value.ToUpper()); this.Guid = actNode.getAttributeOrCreate(Main.GuidStringName).Value; this.TypeGuid = actNode.getAttributeOrCreate("typeGuid").Value; MocaNode assignmentsNode = actNode.getChildNodeWithName("attributeAssignments"); MocaNode constraintsNode = actNode.getChildNodeWithName("constraints"); MocaNode bindingExpressionNode = actNode.getChildNodeWithName("bindingExpression"); if (bindingExpressionNode != null) { this.BindingExpression = Expression.createExpression(bindingExpressionNode.getAttributeOrCreate("type").Value, Repository); this.BindingExpression.deserializeFromMocaTree(bindingExpressionNode); } foreach (MocaNode constraints in constraintsNode.Children) { Constraint constraint = new Constraint(Repository); constraint.deserializeFromMocaTree(constraints); this.Constraints.Add(constraint); } foreach (MocaNode assignments in assignmentsNode.Children) { AttributeAssignment atAs = new AttributeAssignment(Repository); atAs.deserializeFromMocaTree(assignments); this.AttributeAssignments.Add(atAs); } }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { throw new NotImplementedException(); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.DomainType = (DomainType)Enum.Parse(typeof(DomainType), actNode.getAttributeOrCreate("domainType").Value.ToUpper()); this.MetamodelGuid = actNode.getAttributeOrCreate("metamodelGuid").Value; //(BindingOperator)Enum.Parse(typeof(BindingOperator), bindingOperatorAttribute.InnerXml); }
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; }
public override Serialization.MocaTree.MocaNode serializeToMocaTree(Serialization.MocaTree.MocaNode actNode) { actNode.appendChildAttribute(Main.GuidStringName, this.Guid); return(actNode); }
public override void deserializeFromMocaTree(Serialization.MocaTree.MocaNode actNode) { this.Guid = actNode.getAttributeOrCreate(Main.GuidStringName).Value; }