internal static UmlAttributeSpec Convert(CdtConSpec cdtConSpec, string className) { IUmlClassifier type; var multiType = cdtConSpec.BasicType; if (multiType.IsPrim) { type = ((UpccPrim)multiType.Prim).UmlDataType; } else if (multiType.IsIdScheme) { type = ((UpccIdScheme)multiType.IdScheme).UmlDataType; } else if (multiType.IsEnum) { type = ((UpccEnum)multiType.Enum).UmlEnumeration; } else { type = null; } var umlAttributeSpec = new UmlAttributeSpec { Stereotype = "CON", Name = cdtConSpec.Name, Type = type, UpperBound = cdtConSpec.UpperBound, LowerBound = cdtConSpec.LowerBound, TaggedValues = new[] { new UmlTaggedValueSpec("businessTerm", cdtConSpec.BusinessTerms), new UmlTaggedValueSpec("definition", cdtConSpec.Definition), new UmlTaggedValueSpec("dictionaryEntryName", cdtConSpec.DictionaryEntryName) { DefaultValue = GenerateDictionaryEntryNameDefaultValue(cdtConSpec, className) }, new UmlTaggedValueSpec("languageCode", cdtConSpec.LanguageCode), new UmlTaggedValueSpec("modificationAllowedIndicator", cdtConSpec.ModificationAllowedIndicator), new UmlTaggedValueSpec("uniqueIdentifier", cdtConSpec.UniqueIdentifier) { DefaultValue = GenerateUniqueIdentifierDefaultValue(cdtConSpec, className) }, new UmlTaggedValueSpec("versionIdentifier", cdtConSpec.VersionIdentifier), new UmlTaggedValueSpec("usageRule", cdtConSpec.UsageRules), }, }; return(umlAttributeSpec); }
private static string GenerateDictionaryEntryNameDefaultValue(CdtConSpec cdtConSpec, string className) { return(className + ". Content"); }
private static string GenerateUniqueIdentifierDefaultValue(CdtConSpec cdtConSpec, string className) { return(Guid.NewGuid().ToString()); }