Skip to content

Commit 3a46324

Browse files
committed
Add MDA Api
Addiction of Modelio generation of MDA Api
1 parent 6ffe536 commit 3a46324

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+6529
-223
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
<!-- // Build // -->
4242
<build>
43-
<sourceDirectory>Valeur du paramètre </sourceDirectory>
43+
<sourceDirectory>src/main/java</sourceDirectory>
4444
<plugins>
4545
<!-- Use JVM 1.8 -->
4646
<plugin>
@@ -76,7 +76,7 @@
7676
</executions>
7777
<configuration>
7878
<moduleFile>${project.basedir}/src/main/conf/module.xml</moduleFile>
79-
<sourceBasedir>Valeur du paramètre </sourceBasedir>
79+
<sourceBasedir>src/main/java</sourceBasedir>
8080
</configuration>
8181
</plugin>
8282

src/main/conf/module.xml

Lines changed: 59 additions & 200 deletions
Large diffs are not rendered by default.

src/main/java/org/modelio/module/utp/api/IUTPPeerModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import com.modeliosoft.modelio.javadesigner.annotations.objid;
44
import org.modelio.api.module.IPeerModule;
55

6-
@objid ("c013a7be-d851-4a5e-9912-4392d65985e5")
6+
@objid ("6cdd2847-9b53-4b09-930d-64b77ba89918")
77
public interface IUTPPeerModule extends IPeerModule {
8-
@objid ("f716b98d-7f13-42ab-854a-a8906cedd2a6")
8+
@objid ("70f2a8bb-f47d-4511-bd9c-abadf581d12f")
99
public static final String MODULE_NAME = "UTP";
1010

1111
}

src/main/java/org/modelio/module/utp/api/UTPProxyFactory.java

Lines changed: 343 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
/*
2+
* WARNING: GENERATED FILE - DO NOT EDIT
3+
* Module: UTP v4.1.00
4+
5+
* This file was generated on 2/4/21 5:48 PM by Modelio Studio.
6+
*/
7+
package org.modelio.module.utp.api.utpprofile.infrastructure.dependency;
8+
9+
import java.util.ArrayList;
10+
import java.util.Collections;
11+
import java.util.Objects;
12+
import com.modeliosoft.modelio.javadesigner.annotations.objid;
13+
import org.modelio.api.modelio.model.IModelingSession;
14+
import org.modelio.api.modelio.model.PropertyConverter;
15+
import org.modelio.api.module.context.IModuleContext;
16+
import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException;
17+
import org.modelio.metamodel.uml.infrastructure.Dependency;
18+
import org.modelio.metamodel.uml.infrastructure.ModelElement;
19+
import org.modelio.metamodel.uml.infrastructure.Stereotype;
20+
import org.modelio.metamodel.uml.infrastructure.TagType;
21+
import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition;
22+
import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition;
23+
import org.modelio.module.utp.api.IUTPPeerModule;
24+
import org.modelio.module.utp.api.UTPProxyFactory;
25+
import org.modelio.module.utp.impl.UTPModule;
26+
import org.modelio.vcore.smkernel.mapi.MObject;
27+
28+
/**
29+
* Proxy class to handle a {@link Dependency} with << DefaultApplication >> stereotype.
30+
* <p>Stereotype description:
31+
* <br/><i></i></p>
32+
*/
33+
@objid ("1ec3b54d-4fce-448e-a90f-ab7b3d72df11")
34+
public class DefaultApplication {
35+
@objid ("3f58faf6-68e8-4ff3-8545-f7e62c91c388")
36+
public static final String STEREOTYPE_NAME = "DefaultApplication";
37+
38+
/**
39+
* The underlying {@link Dependency} represented by this proxy, never null.
40+
*/
41+
@objid ("c94174db-2b1c-4066-a32c-0fda60d6cfd7")
42+
protected final Dependency elt;
43+
44+
/**
45+
* Tells whether a {@link DefaultApplication proxy} can be instantiated from a {@link MObject} checking it is a {@link Dependency} stereotyped << DefaultApplication >>.
46+
* <p>
47+
* The method returns <code>false</code> if the instantiation cannot be carried out.
48+
*
49+
* @param elt a model object
50+
* @return <code>true</code> if the instantiation can be carried out else <code>false</code>.
51+
*/
52+
@objid ("79fec4f0-6ab7-4b43-a594-5b1be6b010fb")
53+
public static boolean canInstantiate(final MObject elt) {
54+
return ((elt instanceof Dependency) && ((Dependency) elt).isStereotyped(IUTPPeerModule.MODULE_NAME, DefaultApplication.STEREOTYPE_NAME));
55+
}
56+
57+
/**
58+
* Create a new {@link Dependency} stereotyped << DefaultApplication >> then instantiate a {@link DefaultApplication} proxy.
59+
*
60+
* @return a {@link DefaultApplication} proxy on the created {@link Dependency}.
61+
*/
62+
@objid ("e8fa7ac7-ceba-4cc5-a00b-10b3b9ea51f7")
63+
public static DefaultApplication create() {
64+
ModelElement e = (ModelElement)UTPModule.getInstance().getModuleContext().getModelingSession().getModel().createElement("Infrastructure.Dependency");
65+
e.addStereotype(IUTPPeerModule.MODULE_NAME, DefaultApplication.STEREOTYPE_NAME);
66+
return DefaultApplication.instantiate((Dependency)e);
67+
}
68+
69+
/**
70+
* Tries to instantiate a {@link DefaultApplication} proxy from a {@link Dependency} stereotyped << DefaultApplication >> checking its metaclass and its stereotype.
71+
* <p>
72+
* The method returns <i>null</i> if the instantiation cannot be carried out.
73+
* @param obj a Dependency
74+
* @return a {@link DefaultApplication} proxy or <i>null</i>.
75+
*/
76+
@objid ("8d977560-cb96-4389-99ed-6b34dd52af79")
77+
public static DefaultApplication instantiate(final Dependency obj) {
78+
return DefaultApplication.canInstantiate(obj) ? new DefaultApplication(obj) : null;
79+
}
80+
81+
/**
82+
* Tries to instantiate a {@link DefaultApplication} proxy from a {@link Dependency} stereotyped << DefaultApplication >> checking its metaclass and its stereotype.
83+
* <p>
84+
* The method throws an {@link IllegalArgumentException} if the instantiation cannot be carried out.
85+
* @param obj a {@link Dependency}
86+
* @return a {@link DefaultApplication} proxy.
87+
* @throws IllegalArgumentException if the instantiation cannot be carried out.
88+
*/
89+
@objid ("e9393f15-8302-413e-9285-be06efa4beff")
90+
public static DefaultApplication safeInstantiate(final Dependency obj) throws IllegalArgumentException {
91+
if (DefaultApplication.canInstantiate(obj))
92+
return new DefaultApplication(obj);
93+
else
94+
throw new IllegalArgumentException("DefaultApplication: Cannot instantiate "+obj+": wrong element type or stereotype");
95+
}
96+
97+
@objid ("71c8aa8b-dd5d-4d44-a288-3b0e34c89257")
98+
@Override
99+
public boolean equals(final Object obj) {
100+
if (this == obj) {
101+
return true;
102+
}
103+
if (obj == null) {
104+
return false;
105+
}
106+
if (getClass() != obj.getClass()) {
107+
return false;
108+
}
109+
DefaultApplication other = (DefaultApplication) obj;
110+
return java.util.Objects.equals(getElement(), other.getElement());
111+
}
112+
113+
/**
114+
* Get the underlying {@link Dependency}.
115+
* @return the Dependency represented by this proxy, never null.
116+
*/
117+
@objid ("24bc7b57-7a8a-485b-9a41-8716dbca9871")
118+
public Dependency getElement() {
119+
return this.elt;
120+
}
121+
122+
@objid ("4b57e5bb-e03b-4853-8c35-9b2d12c24569")
123+
@Override
124+
public int hashCode() {
125+
return 23 + ((this.elt == null) ? 0 : this.elt.hashCode());
126+
}
127+
128+
@objid ("78ba2795-c070-4515-a71a-e11b5bf5c6a3")
129+
protected DefaultApplication(final Dependency elt) {
130+
this.elt = elt;
131+
}
132+
133+
@objid ("4a25a654-403f-4d59-b27a-1ac366f18c07")
134+
public static final class MdaTypes {
135+
@objid ("2bc1a358-59ea-40b3-8bba-31b8c2ac98fb")
136+
public static Stereotype STEREOTYPE_ELT;
137+
138+
@objid ("1f3f5438-aa5d-43cb-a9ab-a3471830ce05")
139+
private static Stereotype MDAASSOCDEP;
140+
141+
@objid ("16aa7b83-d24c-47a6-9580-4380d5450404")
142+
private static TagType MDAASSOCDEP_ROLE;
143+
144+
@objid ("83b5e660-1ba6-45ca-9d29-1cbd52290d71")
145+
public static void init(final IModuleContext ctx) {
146+
STEREOTYPE_ELT = ctx.getModelingSession().findElementById(Stereotype.class, "50726a80-e339-11df-9694-0027103ea5f4");
147+
MDAASSOCDEP = ctx.getModelingSession().findElementById(Stereotype.class, "94b7efa5-f94c-4d1d-896f-f103e56a8e2e");
148+
MDAASSOCDEP_ROLE = ctx.getModelingSession().findElementById(TagType.class, "7637f2fd-b750-43c1-a15c-5d0b084ca1cd");
149+
}
150+
151+
152+
static {
153+
if(UTPModule.getInstance() != null) {
154+
init(UTPModule.getInstance().getModuleContext());
155+
}
156+
}
157+
}
158+
159+
}
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
/*
2+
* WARNING: GENERATED FILE - DO NOT EDIT
3+
* Module: UTP v4.1.00
4+
5+
* This file was generated on 2/4/21 5:48 PM by Modelio Studio.
6+
*/
7+
package org.modelio.module.utp.api.utpprofile.infrastructure.dependency;
8+
9+
import java.util.ArrayList;
10+
import java.util.Collections;
11+
import java.util.Objects;
12+
import com.modeliosoft.modelio.javadesigner.annotations.objid;
13+
import org.modelio.api.modelio.model.IModelingSession;
14+
import org.modelio.api.modelio.model.PropertyConverter;
15+
import org.modelio.api.module.context.IModuleContext;
16+
import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException;
17+
import org.modelio.metamodel.uml.infrastructure.Dependency;
18+
import org.modelio.metamodel.uml.infrastructure.ModelElement;
19+
import org.modelio.metamodel.uml.infrastructure.Stereotype;
20+
import org.modelio.metamodel.uml.infrastructure.TagType;
21+
import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition;
22+
import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition;
23+
import org.modelio.module.utp.api.IUTPPeerModule;
24+
import org.modelio.module.utp.api.UTPProxyFactory;
25+
import org.modelio.module.utp.impl.UTPModule;
26+
import org.modelio.vcore.smkernel.mapi.MObject;
27+
28+
/**
29+
* Proxy class to handle a {@link Dependency} with << TestLogApplication >> stereotype.
30+
* <p>Stereotype description:
31+
* <br/><i></i></p>
32+
*/
33+
@objid ("317fe033-2547-4920-9d89-394d36f175f9")
34+
public class TestLogApplication {
35+
@objid ("8aae838b-00b7-4cf3-8747-48025514dbe8")
36+
public static final String STEREOTYPE_NAME = "TestLogApplication";
37+
38+
/**
39+
* The underlying {@link Dependency} represented by this proxy, never null.
40+
*/
41+
@objid ("845a8d3e-81a9-4ecd-83ac-131907981487")
42+
protected final Dependency elt;
43+
44+
/**
45+
* Tells whether a {@link TestLogApplication proxy} can be instantiated from a {@link MObject} checking it is a {@link Dependency} stereotyped << TestLogApplication >>.
46+
* <p>
47+
* The method returns <code>false</code> if the instantiation cannot be carried out.
48+
*
49+
* @param elt a model object
50+
* @return <code>true</code> if the instantiation can be carried out else <code>false</code>.
51+
*/
52+
@objid ("c0be3bab-d1c2-459f-9b6f-b6b6093505b0")
53+
public static boolean canInstantiate(final MObject elt) {
54+
return ((elt instanceof Dependency) && ((Dependency) elt).isStereotyped(IUTPPeerModule.MODULE_NAME, TestLogApplication.STEREOTYPE_NAME));
55+
}
56+
57+
/**
58+
* Create a new {@link Dependency} stereotyped << TestLogApplication >> then instantiate a {@link TestLogApplication} proxy.
59+
*
60+
* @return a {@link TestLogApplication} proxy on the created {@link Dependency}.
61+
*/
62+
@objid ("931fab3e-c2c8-453f-b0db-68f7960df5f1")
63+
public static TestLogApplication create() {
64+
ModelElement e = (ModelElement)UTPModule.getInstance().getModuleContext().getModelingSession().getModel().createElement("Infrastructure.Dependency");
65+
e.addStereotype(IUTPPeerModule.MODULE_NAME, TestLogApplication.STEREOTYPE_NAME);
66+
return TestLogApplication.instantiate((Dependency)e);
67+
}
68+
69+
/**
70+
* Tries to instantiate a {@link TestLogApplication} proxy from a {@link Dependency} stereotyped << TestLogApplication >> checking its metaclass and its stereotype.
71+
* <p>
72+
* The method returns <i>null</i> if the instantiation cannot be carried out.
73+
* @param obj a Dependency
74+
* @return a {@link TestLogApplication} proxy or <i>null</i>.
75+
*/
76+
@objid ("dcf99fb1-6617-4b9e-905b-c3cc82b66cef")
77+
public static TestLogApplication instantiate(final Dependency obj) {
78+
return TestLogApplication.canInstantiate(obj) ? new TestLogApplication(obj) : null;
79+
}
80+
81+
/**
82+
* Tries to instantiate a {@link TestLogApplication} proxy from a {@link Dependency} stereotyped << TestLogApplication >> checking its metaclass and its stereotype.
83+
* <p>
84+
* The method throws an {@link IllegalArgumentException} if the instantiation cannot be carried out.
85+
* @param obj a {@link Dependency}
86+
* @return a {@link TestLogApplication} proxy.
87+
* @throws IllegalArgumentException if the instantiation cannot be carried out.
88+
*/
89+
@objid ("e4aeabb4-cc39-4eec-85f3-6b2904bb56da")
90+
public static TestLogApplication safeInstantiate(final Dependency obj) throws IllegalArgumentException {
91+
if (TestLogApplication.canInstantiate(obj))
92+
return new TestLogApplication(obj);
93+
else
94+
throw new IllegalArgumentException("TestLogApplication: Cannot instantiate "+obj+": wrong element type or stereotype");
95+
}
96+
97+
@objid ("3dbfce21-080b-48ce-9753-979906fcce48")
98+
@Override
99+
public boolean equals(final Object obj) {
100+
if (this == obj) {
101+
return true;
102+
}
103+
if (obj == null) {
104+
return false;
105+
}
106+
if (getClass() != obj.getClass()) {
107+
return false;
108+
}
109+
TestLogApplication other = (TestLogApplication) obj;
110+
return java.util.Objects.equals(getElement(), other.getElement());
111+
}
112+
113+
/**
114+
* Get the underlying {@link Dependency}.
115+
* @return the Dependency represented by this proxy, never null.
116+
*/
117+
@objid ("2ddedc31-9857-48f0-93c0-229c9af4e81a")
118+
public Dependency getElement() {
119+
return this.elt;
120+
}
121+
122+
@objid ("414eab78-9103-45e9-8aea-a43ec4c45191")
123+
@Override
124+
public int hashCode() {
125+
return 23 + ((this.elt == null) ? 0 : this.elt.hashCode());
126+
}
127+
128+
@objid ("7e8f317a-77f2-4159-a629-2c334da67d21")
129+
protected TestLogApplication(final Dependency elt) {
130+
this.elt = elt;
131+
}
132+
133+
@objid ("0db3dd61-273b-430a-8886-40fc5d2b111f")
134+
public static final class MdaTypes {
135+
@objid ("f28cb754-228b-482d-988f-4ce7fef8a7fc")
136+
public static Stereotype STEREOTYPE_ELT;
137+
138+
@objid ("8171a09b-b511-46df-a9ef-e2d5e534986d")
139+
private static Stereotype MDAASSOCDEP;
140+
141+
@objid ("95249243-fc55-4d4d-ad08-ea64d6027eb8")
142+
private static TagType MDAASSOCDEP_ROLE;
143+
144+
@objid ("1dd3aaf2-78d1-41dc-8660-af9b433525a1")
145+
public static void init(final IModuleContext ctx) {
146+
STEREOTYPE_ELT = ctx.getModelingSession().findElementById(Stereotype.class, "83ba8aa0-e2ab-11df-b4b4-0027103ea5f4");
147+
MDAASSOCDEP = ctx.getModelingSession().findElementById(Stereotype.class, "94b7efa5-f94c-4d1d-896f-f103e56a8e2e");
148+
MDAASSOCDEP_ROLE = ctx.getModelingSession().findElementById(TagType.class, "7637f2fd-b750-43c1-a15c-5d0b084ca1cd");
149+
}
150+
151+
152+
static {
153+
if(UTPModule.getInstance() != null) {
154+
init(UTPModule.getInstance().getModuleContext());
155+
}
156+
}
157+
}
158+
159+
}

0 commit comments

Comments
 (0)