Beispiel #1
0
        ///<summary>
        ///</summary>
        ///<param name="asbie"></param>
        ///<returns></returns>
        public static XmlSchemaAnnotation GetASBIEAnnotiation(IAsbie asbie)
        {
            // Contains all the documentation items such as DictionaryEntryName
            IList <XmlNode> documentation = new List <XmlNode>();

            AddDocumentation(documentation, "UniqueID", asbie.UniqueIdentifier);
            AddDocumentation(documentation, "VersionID", asbie.VersionIdentifier);
            AddDocumentation(documentation, "Cardinality", asbie.LowerBound + ".." + asbie.UpperBound);
            AddDocumentation(documentation, "SequencingKey", asbie.SequencingKey);
            AddDocumentation(documentation, "DictionaryEntryName", asbie.DictionaryEntryName);
            AddDocumentation(documentation, "Definition", asbie.Definition);
            AddDocumentation(documentation, "BusinessTermName", asbie.BusinessTerms);
            AddDocumentation(documentation, "AssociationType", asbie.AggregationKind.ToString());
            AddDocumentation(documentation, "PropertyTermName", asbie.Name);
            // PropertyQualifierName could be extracted from the PropertyTermName (e.g. "My" in
            // "My_Address") but is not implement at this point
            AddDocumentation(documentation, "PropertyQualifierName", "");
            AddDocumentation(documentation, "AssociatedObjectClassTermName", asbie.AssociatedAbie.Name);
            // AssociatedObjectClassQualifierTermName could be extracted from the AssociatedObjectClassTermName
            // (e.g. "My" in "My_Address") but is not implement at this point
            AddDocumentation(documentation, "AcronymCode", "ASBIE");


            XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();

            annotation.Items.Add(new XmlSchemaDocumentation {
                Language = "en", Markup = documentation.ToArray()
            });

            return(annotation);
        }
        static XmlSchemaElement CreateAsbieSchemaElement(IAsbie asbie, GeneratorContext context, XmlSchema schema)
        {
            XmlSchemaElement refASBIE = new XmlSchemaElement();

            refASBIE.Name            = NDR.GetXsdElementNameFromAsbie(asbie);
            refASBIE.SchemaTypeName  = new XmlQualifiedName(context.NamespacePrefix + ":" + NDR.TrimElementName(asbie.AssociatedAbie.Name));
            refASBIE.MinOccursString = AdjustBound(asbie.LowerBound);
            refASBIE.MaxOccursString = AdjustBound(asbie.UpperBound);
            return(refASBIE);
        }
 public static AsbieSpec CloneAsbie(IAsbie asbie)
 {
     return(new AsbieSpec
     {
         Name = asbie.Name,
         UpperBound = asbie.UpperBound,
         LowerBound = asbie.LowerBound,
         AggregationKind = asbie.AggregationKind,
         AssociatedAbie = asbie.AssociatedAbie,
         BasedOn = asbie.BasedOn,
         BusinessTerms = new List <string>(asbie.BusinessTerms),
         Definition = asbie.Definition,
         LanguageCode = asbie.LanguageCode,
         SequencingKey = asbie.SequencingKey,
         VersionIdentifier = asbie.VersionIdentifier,
         UsageRules = new List <string>(asbie.UsageRules),
     });
 }
Beispiel #4
0
 /// <summary>
 /// Removes a(n) ASBIE from this ABIE.
 /// <param name="asbie">A(n) ASBIE.</param>
 /// </summary>
 public void RemoveAsbie(IAsbie asbie)
 {
     UmlClass.RemoveAssociation(((UpccAsbie)asbie).UmlAssociation);
 }
Beispiel #5
0
 /// <summary>
 /// Updates a(n) ASBIE to match the given <paramref name="specification"/>.
 /// <param name="asbie">A(n) ASBIE.</param>
 /// <param name="specification">A new specification for the given ASBIE.</param>
 /// <returns>The updated ASBIE. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IAsbie UpdateAsbie(IAsbie asbie, AsbieSpec specification)
 {
     return(new UpccAsbie(UmlClass.UpdateAssociation(((UpccAsbie)asbie).UmlAssociation, AsbieSpecConverter.Convert(specification, Name)), this));
 }
Beispiel #6
0
 public static string GetXsdElementNameFromAsbie(IAsbie asbie)
 {
     return(TrimElementName(asbie.Name + asbie.AssociatedAbie.Name));
 }