internal static UmlClassSpec Convert(MaSpec maSpec)
        {
            var umlClassSpec = new UmlClassSpec
            {
                Stereotype = "MA",
                Name       = maSpec.Name,
            };

            var associationSpecs = new List <UmlAssociationSpec>();

            if (maSpec.Asmas != null)
            {
                foreach (var asmaSpec in maSpec.Asmas)
                {
                    associationSpecs.Add(AsmaSpecConverter.Convert(asmaSpec, maSpec.Name));
                }
            }
            umlClassSpec.Associations = MakeAssociationNamesUnique(associationSpecs);

            return(umlClassSpec);
        }
Beispiel #2
0
 /// <summary>
 /// Updates a(n) ASMA to match the given <paramref name="specification"/>.
 /// <param name="asma">A(n) ASMA.</param>
 /// <param name="specification">A new specification for the given ASMA.</param>
 /// <returns>The updated ASMA. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IAsma UpdateAsma(IAsma asma, AsmaSpec specification)
 {
     return(new UpccAsma(UmlClass.UpdateAssociation(((UpccAsma)asma).UmlAssociation, AsmaSpecConverter.Convert(specification, Name)), this));
 }
Beispiel #3
0
 /// <summary>
 /// Creates a(n) ASMA based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a(n) ASMA.</param>
 /// <returns>The newly created ASMA.</returns>
 /// </summary>
 public IAsma CreateAsma(AsmaSpec specification)
 {
     return(new UpccAsma(UmlClass.CreateAssociation(AsmaSpecConverter.Convert(specification, Name)), this));
 }