public EMOF.IType ConstructTypeOfMethod(EnAr.Method method) { if (method.ReturnType == null) { return(null); } EnAr.Element returnType = explorer.repository.GetElementByGuid(method.ReturnType); if (returnType != null) { return(ConstructType(returnType)); } else { return(ConstructPrimitiveType(method.ReturnType)); } }
private EMOF.IOperation ConstructOperation(EnAr.Method method) { //TODO type: is the classifierID the return type? EMOF.IOperation operation = new EMOF.Operation() { Name = method.Name, Lower = 0, Upper = method.ReturnIsArray ? 1 : -1, // type = type }; foreach (EnAr.Parameter enArParameter in method.Parameters) { EMOF.IParameter parameter = ConstructParameter(enArParameter); parameter.Operation = operation; operation.OwnedParameter.Add(parameter); } return(operation); }
private QVTBase.Function ConstructFunction(QVTRelations.RelationalTransformation transformation, EnAr.Method method) { QVTBase.Function result = new QVTBase.Function() { Type = emofImporter.ConstructTypeOfMethod(method), Name = method.Name, Class = transformation, IsOrdered = false, IsUnique = false, Lower = 1, Upper = 1, OwnedComment = { }, QueryExpression = null, RaisedException = { }, ReferencedElements = { }, // TODO ??? }; foreach (EnAr.Parameter parameter in method.Parameters) { ConstructParameter(result, parameter); } return(result); }