Exemplo n.º 1
0
      /// <summary>Build BPL classes and packages repository.</summary>
      private void buildRepository() {

         // Init collections
         //elementIDs = new Dictionary<string, string>();
         packages = new Index<string, BplPackage>(p => p.CanonicName);
         elements = new HashSet<BplClass>();
         classes = new HashSet<BplClass>();
         singletons = new HashSet<BplClass>();
         collections = new HashSet<BplClass>();
         primitives = new HashSet<BplPrimitive>();
         arrays = new HashSet<BplPrimitive>();

         // Build Package Tree
         int ns = BplLanguage.Namespaces.Count<BplNamespace>();
         BplLanguage.Classes.Apply(cls => mapPackageFromClass(cls));
         packages.Apply<BplPackage>(pkg => { if (!pkg.IsRoot) packages[pkg.Parent].Packages.Add(pkg); });

         // Add all classes to tree
         BplLanguage.Classes.Apply<BplClass>(cls => addClass(cls));
      }
Exemplo n.º 2
0
 /// <summary>Build standard XMI extentions.</summary>
 protected virtual void buildUmlExtentions(Index<string, BplPackage> packages) {
    if (!this.IsUmlExtensionIncluded) return;
    packages.Apply<BplPackage>(pkg => { if (pkg.IsRoot) AddUmlExtensions(pkg); });
 }
Exemplo n.º 3
0
      /// <summary>Build tool specific XMI extentions.</summary>
      protected virtual void buildToolExtentions(Index<string, BplPackage> packages) {
         if (!this.IsToolExtensionIncluded) return;
         packages.Apply<BplPackage>(pkg => { if (pkg.IsRoot) AddToolExtensions(pkg); });

         // Add primitive types
         XElement xEAPrimitiveTypesPackage = new XElement("packagedElement",
             new XAttribute(xmiNs + "type", "uml:Package"),
             new XAttribute(xmiNs + "id", "EAPrimitiveTypesPackage"),
             new XAttribute("name", "EA_PrimitiveTypes_Package"),
             new XAttribute("visibility", "public"));
         
         XElement xEATypesPackage = new XElement("packagedElement",
             new XAttribute(xmiNs + "type", "uml:Package"),
             new XAttribute(xmiNs + "id", "EAC#TypesPackage"),
             new XAttribute("name", "EA_PrimitiveTypes_Package"),
             new XAttribute("visibility", "public"));

         Dictionary<string, string> usedTypes = XmiHelper.GetUsedTypes();
         usedTypes.Keys.Apply<string>(key => {
            xEATypesPackage.Add(new XElement("packagedElement",
               new XAttribute(xmiNs + "id", key),
               new XAttribute("name", usedTypes[key]),
               new XAttribute("visibility", "public")));
         });

         xEAPrimitiveTypesPackage.Add(xEATypesPackage);
         XmiPrimitives.Add(xEAPrimitiveTypesPackage);
      }
Exemplo n.º 4
0
 /// <summary>Build standard XMI modle.</summary>
 private void buildUmlXmi(Index<string, BplPackage> packages) {
    // Add Packages
    packages.Apply<BplPackage>(pkg => { if (pkg.IsRoot) this.XmiModel.Add(pkg.GetXmi()); });
 }