Example #1
0
        private static XmlSchemaAnnotation GetAttributeAnnotation(IBdtSup sup)
        {
            var xml = new XmlDocument();
            // Deviation from rule [R 9C95]: Generating only a subset of the defined annotations and added some additional annotations.
            var annNodes = new List <XmlNode>();

            AddAnnotation(xml, annNodes, "PropertyTermName", sup.Name);
            AddAnnotation(xml, annNodes, "RepresentationTermName", sup.BasicType.Name);
            AddAnnotation(xml, annNodes, "PrimitiveTypeName", sup.BasicType.Name);
            AddAnnotation(xml, annNodes, "DataTypeName", sup.Bdt.Name);
            AddAnnotation(xml, annNodes, "UniqueID", sup.UniqueIdentifier);
            AddAnnotation(xml, annNodes, "VersionID", sup.VersionIdentifier);
            AddAnnotation(xml, annNodes, "DictionaryEntryName", sup.DictionaryEntryName);
            AddAnnotation(xml, annNodes, "Definition", sup.Definition);
            AddAnnotations(xml, annNodes, "BusinessTermName", sup.BusinessTerms);
            AddAnnotation(xml, annNodes, "ModificationAllowedIndicator",
                          sup.ModificationAllowedIndicator.ToString().ToLower());
            AddAnnotation(xml, annNodes, "LanguageCode", sup.LanguageCode);
            AddAnnotation(xml, annNodes, "AcronymCode", "SUP");
            var ann = new XmlSchemaAnnotation();

            ann.Items.Add(new XmlSchemaDocumentation {
                Language = "en", Markup = annNodes.ToArray()
            });
            return(ann);
        }
Example #2
0
 public static BdtSupSpec CloneBdtSup(IBdtSup bdtSup)
 {
     return(new BdtSupSpec
     {
         Name = bdtSup.Name,
         UpperBound = bdtSup.UpperBound,
         LowerBound = bdtSup.LowerBound,
         BasicType = bdtSup.BasicType,
         BusinessTerms = new List <string>(bdtSup.BusinessTerms),
         Definition = bdtSup.Definition,
         Enumeration = bdtSup.Enumeration,
         FractionDigits = bdtSup.FractionDigits,
         LanguageCode = bdtSup.LanguageCode,
         MaximumExclusive = bdtSup.MaximumExclusive,
         MaximumInclusive = bdtSup.MaximumInclusive,
         MaximumLength = bdtSup.MaximumLength,
         MinimumExclusive = bdtSup.MinimumExclusive,
         MinimumInclusive = bdtSup.MinimumInclusive,
         MinimumLength = bdtSup.MinimumLength,
         ModificationAllowedIndicator = bdtSup.ModificationAllowedIndicator,
         Pattern = bdtSup.Pattern,
         TotalDigits = bdtSup.TotalDigits,
         UsageRules = new List <string>(bdtSup.UsageRules),
         VersionIdentifier = bdtSup.VersionIdentifier,
     });
 }
Example #3
0
 public static string GetXsdAttributeNameFromSup(IBdtSup sup)
 {
     return(GetXsdAttributeName(sup));
 }
 /// <summary>
 /// Removes a(n) SUP from this BDT.
 /// <param name="bdtSup">A(n) SUP.</param>
 /// </summary>
 public void RemoveBdtSup(IBdtSup bdtSup)
 {
     UmlClass.RemoveAttribute(((UpccBdtSup)bdtSup).UmlAttribute);
 }
 /// <summary>
 /// Updates a(n) SUP to match the given <paramref name="specification"/>.
 /// <param name="bdtSup">A(n) SUP.</param>
 /// <param name="specification">A new specification for the given SUP.</param>
 /// <returns>The updated SUP. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IBdtSup UpdateBdtSup(IBdtSup bdtSup, BdtSupSpec specification)
 {
     return(new UpccBdtSup(UmlClass.UpdateAttribute(((UpccBdtSup)bdtSup).UmlAttribute, BdtSupSpecConverter.Convert(specification, Name)), this));
 }
Example #6
0
        public static string GetXsdAttributeNameFromSup(IBdtSup sup)
        {
            string name = sup.Name + sup.BasicType.Name;

            return(name.Replace(".", String.Empty));
        }