internal static UmlEnumerationSpec Convert(EnumSpec enumSpec) { var umlEnumerationSpec = new UmlEnumerationSpec { Stereotype = "ENUM", Name = enumSpec.Name, TaggedValues = new[] { new UmlTaggedValueSpec("businessTerm", enumSpec.BusinessTerms), new UmlTaggedValueSpec("codeListAgencyIdentifier", enumSpec.CodeListAgencyIdentifier), new UmlTaggedValueSpec("codeListAgencyName", enumSpec.CodeListAgencyName), new UmlTaggedValueSpec("codeListIdentifier", enumSpec.CodeListIdentifier), new UmlTaggedValueSpec("codeListName", enumSpec.CodeListName), new UmlTaggedValueSpec("dictionaryEntryName", enumSpec.DictionaryEntryName) { DefaultValue = GenerateDictionaryEntryNameDefaultValue(enumSpec) }, new UmlTaggedValueSpec("definition", enumSpec.Definition), new UmlTaggedValueSpec("enumerationURI", enumSpec.EnumerationURI), new UmlTaggedValueSpec("languageCode", enumSpec.LanguageCode), new UmlTaggedValueSpec("modificationAllowedIndicator", enumSpec.ModificationAllowedIndicator), new UmlTaggedValueSpec("restrictedPrimitive", enumSpec.RestrictedPrimitive), new UmlTaggedValueSpec("status", enumSpec.Status), new UmlTaggedValueSpec("uniqueIdentifier", enumSpec.UniqueIdentifier) { DefaultValue = GenerateUniqueIdentifierDefaultValue(enumSpec) }, new UmlTaggedValueSpec("versionIdentifier", enumSpec.VersionIdentifier), }, }; var dependencySpecs = new List <UmlDependencySpec>(); if (enumSpec.IsEquivalentTo != null) { dependencySpecs.Add(new UmlDependencySpec { Stereotype = "isEquivalentTo", Target = ((UpccEnum)enumSpec.IsEquivalentTo).UmlEnumeration, LowerBound = "0", UpperBound = "1", }); } umlEnumerationSpec.Dependencies = dependencySpecs; var enumerationLiteralSpecs = new List <UmlEnumerationLiteralSpec>(); if (enumSpec.CodelistEntries != null) { foreach (var codelistEntrySpec in enumSpec.CodelistEntries) { enumerationLiteralSpecs.Add(CodelistEntrySpecConverter.Convert(codelistEntrySpec)); } } umlEnumerationSpec.EnumerationLiterals = enumerationLiteralSpecs; return(umlEnumerationSpec); }
public IUmlEnumeration UpdateEnumeration(IUmlEnumeration umlEnumeration, UmlEnumerationSpec spec) { UpdateEaUmlClassifier((EaUmlClassifier)umlEnumeration, spec); return(umlEnumeration); }
public IUmlEnumeration CreateEnumeration(UmlEnumerationSpec spec) { return(CreateEaUmlClassifier(spec)); }