Exemplo n.º 1
0
        public CoreOperation createSpecificOperation(CoreClassifier classifier, String name, List <object> paramNames, List <object> paramTypes, CoreClassifier returnType)
        {
            UmlPackage mainPackage = (UmlPackage)classifier.getModel().getMainPackage();

            Operation operation = mainPackage.getFoundation().getCore().getOperation();

            operation.setName(name);
            operation.setNamespace((Classifier)this);

            for (int i = 0; i < paramNames.Count; i++)
            {
                String    paramName    = (String)paramNames[i];
                Parameter newParameter = mainPackage.getFoundation().getCore().getParameter();

                newParameter.setBehavioralFeature(operation);
                newParameter.setName(paramName);
                newParameter.setType((Classifier)paramTypes[i]);
                newParameter.setKind(ParameterDirectionKindEnum.PDK_IN);
            }

            Parameter returnParameter = mainPackage.getFoundation().getCore().getParameter();

            returnParameter.setBehavioralFeature(operation);
            returnParameter.setName("return");
            returnParameter.setType((Classifier)returnType);
            returnParameter.setKind(ParameterDirectionKindEnum.PDK_RETURN);

            return((CoreOperation)operation);
        }
 /// <summary>
 /// The bLibrarys contained in this bLibrary.
 /// </summary>
 public IEnumerable <IBLibrary> GetBLibraries()
 {
     foreach (var package in UmlPackage.GetPackagesByStereotype("bLibrary"))
     {
         yield return(new UpccBLibrary(package));
     }
 }
Exemplo n.º 3
0
        public void createSpecificStereotype(CoreClassifier classifier, CoreFeature feature, String stereotypeName)
        {
            UmlPackage mainPackage = (UmlPackage)classifier.getModel().getMainPackage();

            //verificar
            Stereotype stereotype = mainPackage.getFoundation().getExtensionMechanisms().getStereotype();

            stereotype.setName(stereotypeName);
            mainPackage.getFoundation().getExtensionMechanisms().getAStereotypeExtendedElement().add(stereotype, (Feature)feature);
        }
Exemplo n.º 4
0
        public CoreAttribute createSpecificAttribute(CoreClassifier classifier, String name, CoreClassifier type)
        {
            UmlPackage mainPackage = (UmlPackage)classifier.getModel().getMainPackage();

            Attribute attribute = mainPackage.getFoundation().getCore().getAttribute();

            attribute.setName(name);
            attribute.setNamespace((Classifier)classifier);
            attribute.setType((Classifier)type);

            return((CoreAttribute)attribute);
        }
        public void Export(UmlPackage umlPackage)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("skinparam monochrome true");
            stringBuilder.AppendLine($"package {umlPackage.Name}");
            stringBuilder.AppendLine("{");
            foreach (var umlClass in umlPackage.UmlModel.UmlClasses)
            {
                BuildClass(stringBuilder, umlClass);
            }
            stringBuilder.AppendLine("}");
            Console.WriteLine(stringBuilder.ToString());
        }
 /// <summary>
 /// Retrieves a bLibrary by name.
 /// <param name="name">A bLibrary's name.</param>
 /// <returns>The bLibrary with the given <paramref name="name"/> or <c>null</c> if no such bLibrary is found.</returns>
 /// </summary>
 public IBLibrary GetBLibraryByName(string name)
 {
     if (string.IsNullOrEmpty(name))
     {
         return(null);
     }
     foreach (var package in UmlPackage.GetPackagesByStereotype("bLibrary"))
     {
         if (name == package.Name)
         {
             return(new UpccBLibrary(package));
         }
     }
     return(null);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Updates a ABIE to match the given <paramref name="specification"/>.
 /// <param name="abie">A ABIE.</param>
 /// <param name="specification">A new specification for the given ABIE.</param>
 /// <returns>The updated ABIE. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IAbie UpdateAbie(IAbie abie, AbieSpec specification)
 {
     return(new UpccAbie(UmlPackage.UpdateClass(((UpccAbie)abie).UmlClass, AbieSpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Removes a CDT from this CDTLibrary.
 /// <param name="cdt">A CDT.</param>
 /// </summary>
 public void RemoveCdt(ICdt cdt)
 {
     UmlPackage.RemoveClass(((UpccCdt)cdt).UmlClass);
 }
 /// <summary>
 /// Updates a CDT to match the given <paramref name="specification"/>.
 /// <param name="cdt">A CDT.</param>
 /// <param name="specification">A new specification for the given CDT.</param>
 /// <returns>The updated CDT. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public ICdt UpdateCdt(ICdt cdt, CdtSpec specification)
 {
     return(new UpccCdt(UmlPackage.UpdateClass(((UpccCdt)cdt).UmlClass, CdtSpecConverter.Convert(specification))));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Creates a ACC based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a ACC.</param>
 /// <returns>The newly created ACC.</returns>
 /// </summary>
 public IAcc CreateAcc(AccSpec specification)
 {
     return(new UpccAcc(UmlPackage.CreateClass(AccSpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Updates a ENUM to match the given <paramref name="specification"/>.
 /// <param name="@enum">A ENUM.</param>
 /// <param name="specification">A new specification for the given ENUM.</param>
 /// <returns>The updated ENUM. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IEnum UpdateEnum(IEnum @enum, EnumSpec specification)
 {
     return(new UpccEnum(UmlPackage.UpdateEnumeration(((UpccEnum)@enum).UmlEnumeration, EnumSpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Creates a IDSCHEME based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a IDSCHEME.</param>
 /// <returns>The newly created IDSCHEME.</returns>
 /// </summary>
 public IIdScheme CreateIdScheme(IdSchemeSpec specification)
 {
     return(new UpccIdScheme(UmlPackage.CreateDataType(IdSchemeSpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Removes a IDSCHEME from this ENUMLibrary.
 /// <param name="idScheme">A IDSCHEME.</param>
 /// </summary>
 public void RemoveIdScheme(IIdScheme idScheme)
 {
     UmlPackage.RemoveDataType(((UpccIdScheme)idScheme).UmlDataType);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Removes a PRIM from this PRIMLibrary.
 /// <param name="prim">A PRIM.</param>
 /// </summary>
 public void RemovePrim(IPrim prim)
 {
     UmlPackage.RemoveDataType(((UpccPrim)prim).UmlDataType);
 }
Exemplo n.º 15
0
 /// <summary>
 /// Updates a PRIM to match the given <paramref name="specification"/>.
 /// <param name="prim">A PRIM.</param>
 /// <param name="specification">A new specification for the given PRIM.</param>
 /// <returns>The updated PRIM. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IPrim UpdatePrim(IPrim prim, PrimSpec specification)
 {
     return(new UpccPrim(UmlPackage.UpdateDataType(((UpccPrim)prim).UmlDataType, PrimSpecConverter.Convert(specification))));
 }
Exemplo n.º 16
0
 /// <summary>
 /// Creates a MA based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a MA.</param>
 /// <returns>The newly created MA.</returns>
 /// </summary>
 public IMa CreateMa(MaSpec specification)
 {
     return(new UpccMa(UmlPackage.CreateClass(MaSpecConverter.Convert(specification))));
 }
Exemplo n.º 17
0
 /// <summary>
 /// Removes a MA from this DOCLibrary.
 /// <param name="ma">A MA.</param>
 /// </summary>
 public void RemoveMa(IMa ma)
 {
     UmlPackage.RemoveClass(((UpccMa)ma).UmlClass);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Updates a MA to match the given <paramref name="specification"/>.
 /// <param name="ma">A MA.</param>
 /// <param name="specification">A new specification for the given MA.</param>
 /// <returns>The updated MA. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IMa UpdateMa(IMa ma, MaSpec specification)
 {
     return(new UpccMa(UmlPackage.UpdateClass(((UpccMa)ma).UmlClass, MaSpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Removes a ENUM from this ENUMLibrary.
 /// <param name="@enum">A ENUM.</param>
 /// </summary>
 public void RemoveEnum(IEnum @enum)
 {
     UmlPackage.RemoveEnumeration(((UpccEnum)@enum).UmlEnumeration);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Removes a ABIE from this BIELibrary.
 /// <param name="abie">A ABIE.</param>
 /// </summary>
 public void RemoveAbie(IAbie abie)
 {
     UmlPackage.RemoveClass(((UpccAbie)abie).UmlClass);
 }
Exemplo n.º 21
0
 /// <summary>
 /// Creates a ABIE based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a ABIE.</param>
 /// <returns>The newly created ABIE.</returns>
 /// </summary>
 public IAbie CreateAbie(AbieSpec specification)
 {
     return(new UpccAbie(UmlPackage.CreateClass(AbieSpecConverter.Convert(specification))));
 }
Exemplo n.º 22
0
 public override int GetHashCode()
 {
     return(UmlPackage != null ? UmlPackage.GetHashCode() : 0);
 }
 /// <summary>
 /// Updates a IDSCHEME to match the given <paramref name="specification"/>.
 /// <param name="idScheme">A IDSCHEME.</param>
 /// <param name="specification">A new specification for the given IDSCHEME.</param>
 /// <returns>The updated IDSCHEME. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IIdScheme UpdateIdScheme(IIdScheme idScheme, IdSchemeSpec specification)
 {
     return(new UpccIdScheme(UmlPackage.UpdateDataType(((UpccIdScheme)idScheme).UmlDataType, IdSchemeSpecConverter.Convert(specification))));
 }
Exemplo n.º 24
0
 /// <summary>
 /// Updates a BDT to match the given <paramref name="specification"/>.
 /// <param name="bdt">A BDT.</param>
 /// <param name="specification">A new specification for the given BDT.</param>
 /// <returns>The updated BDT. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IBdt UpdateBdt(IBdt bdt, BdtSpec specification)
 {
     return(new UpccBdt(UmlPackage.UpdateClass(((UpccBdt)bdt).UmlClass, BdtSpecConverter.Convert(specification))));
 }
Exemplo n.º 25
0
 /// <summary>
 /// Creates a PRIM based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a PRIM.</param>
 /// <returns>The newly created PRIM.</returns>
 /// </summary>
 public IPrim CreatePrim(PrimSpec specification)
 {
     return(new UpccPrim(UmlPackage.CreateDataType(PrimSpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Creates a ENUM based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a ENUM.</param>
 /// <returns>The newly created ENUM.</returns>
 /// </summary>
 public IEnum CreateEnum(EnumSpec specification)
 {
     return(new UpccEnum(UmlPackage.CreateEnumeration(EnumSpecConverter.Convert(specification))));
 }
Exemplo n.º 27
0
 /// <summary>
 /// Creates a BDT based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a BDT.</param>
 /// <returns>The newly created BDT.</returns>
 /// </summary>
 public IBdt CreateBdt(BdtSpec specification)
 {
     return(new UpccBdt(UmlPackage.CreateClass(BdtSpecConverter.Convert(specification))));
 }
Exemplo n.º 28
0
 /// <summary>
 /// Updates a ACC to match the given <paramref name="specification"/>.
 /// <param name="acc">A ACC.</param>
 /// <param name="specification">A new specification for the given ACC.</param>
 /// <returns>The updated ACC. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IAcc UpdateAcc(IAcc acc, AccSpec specification)
 {
     return(new UpccAcc(UmlPackage.UpdateClass(((UpccAcc)acc).UmlClass, AccSpecConverter.Convert(specification))));
 }
Exemplo n.º 29
0
 /// <summary>
 /// Removes a BDT from this BDTLibrary.
 /// <param name="bdt">A BDT.</param>
 /// </summary>
 public void RemoveBdt(IBdt bdt)
 {
     UmlPackage.RemoveClass(((UpccBdt)bdt).UmlClass);
 }
Exemplo n.º 30
0
 /// <summary>
 /// Removes a ACC from this CCLibrary.
 /// <param name="acc">A ACC.</param>
 /// </summary>
 public void RemoveAcc(IAcc acc)
 {
     UmlPackage.RemoveClass(((UpccAcc)acc).UmlClass);
 }