Skip to content

Commit 31ef8ec

Browse files
committed
ST6RI-805 Creates adapters for types with multiple generalizations
The created adapters do not provide any functionality themselves but simply make the currently implicit general class selection of the AdapterFactory explicit. This change should not introduce any functional changes with regards to the metamodel itself.
1 parent f4de6f1 commit 31ef8ec

13 files changed

Lines changed: 601 additions & 1 deletion
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Zoltan Ujhelyi, MDS
22+
*/
23+
24+
package org.omg.sysml.adapter;
25+
26+
import org.omg.sysml.lang.sysml.AssociationStructure;
27+
28+
/**
29+
* This adapter does not introduce any specific behavior compared to the
30+
* {@link AssociationAdapter} but it is introduced to allow unexpected behavior
31+
* changes when regenerating the EMF models (as sometimes the order of multiple
32+
* generalizations changes).
33+
*/
34+
public class AssociationStructureAdapter extends AssociationAdapter {
35+
36+
public AssociationStructureAdapter(AssociationStructure element) {
37+
super(element);
38+
}
39+
40+
@Override
41+
public AssociationStructure getTarget() {
42+
return (AssociationStructure)super.getTarget();
43+
}
44+
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Zoltan Ujhelyi, MDS
22+
*/
23+
24+
package org.omg.sysml.adapter;
25+
26+
import org.omg.sysml.lang.sysml.AttributeDefinition;
27+
28+
/**
29+
* This adapter does not introduce any specific behavior compared to the
30+
* {@link DefinitionAdapter} but it is introduced to allow unexpected behavior
31+
* changes when regenerating the EMF models (as sometimes the order of multiple
32+
* generalizations changes).
33+
*/
34+
public class AttributeDefinitionAdapter extends DefinitionAdapter {
35+
36+
public AttributeDefinitionAdapter(AttributeDefinition element) {
37+
super(element);
38+
}
39+
40+
@Override
41+
public AttributeDefinition getTarget() {
42+
return (AttributeDefinition)super.getTarget();
43+
}
44+
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Zoltan Ujhelyi, MDS
22+
*/
23+
24+
package org.omg.sysml.adapter;
25+
26+
import org.omg.sysml.lang.sysml.BindingConnectorAsUsage;
27+
28+
/**
29+
* This adapter does not introduce any specific behavior compared to the
30+
* {@link ConnectorAsUsageAdapter} but it is introduced to allow unexpected behavior
31+
* changes when regenerating the EMF models (as sometimes the order of multiple
32+
* generalizations changes).
33+
*/
34+
public class BindingConnectorAsUsageAdapter extends ConnectorAsUsageAdapter {
35+
36+
public BindingConnectorAsUsageAdapter(BindingConnectorAsUsage element) {
37+
super(element);
38+
}
39+
40+
@Override
41+
public BindingConnectorAsUsage getTarget() {
42+
return (BindingConnectorAsUsage)super.getTarget();
43+
}
44+
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Zoltan Ujhelyi, MDS
22+
*/
23+
24+
package org.omg.sysml.adapter;
25+
26+
import org.omg.sysml.lang.sysml.ConnectorAsUsage;
27+
28+
/**
29+
* This adapter does not introduce any specific behavior compared to the
30+
* {@link UsageAdapter} but it is introduced to allow unexpected behavior
31+
* changes when regenerating the EMF models (as sometimes the order of multiple
32+
* generalizations changes).
33+
*/
34+
public class ConnectorAsUsageAdapter extends UsageAdapter {
35+
36+
public ConnectorAsUsageAdapter(ConnectorAsUsage element) {
37+
super(element);
38+
}
39+
40+
@Override
41+
public ConnectorAsUsage getTarget() {
42+
return (ConnectorAsUsage)super.getTarget();
43+
}
44+
45+
}

org.omg.sysml/src/org/omg/sysml/adapter/ElementAdapterFactory.java

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public ElementAdapter caseActionUsage(ActionUsage element) {
8686
public ElementAdapter caseAnnotatingElement(AnnotatingElement element) {
8787
return new AnnotatingElementAdapter(element);
8888
}
89-
89+
9090
@Override
9191
public ElementAdapter caseAssertConstraintUsage(AssertConstraintUsage element) {
9292
return new AssertConstraintUsageAdapter(element);
@@ -102,6 +102,16 @@ public ElementAdapter caseAssociation(Association element) {
102102
return new AssociationAdapter(element);
103103
}
104104

105+
@Override
106+
public ElementAdapter caseAssociationStructure(AssociationStructure element) {
107+
return new AssociationStructureAdapter(element);
108+
}
109+
110+
@Override
111+
public ElementAdapter caseAttributeDefinition(AttributeDefinition element) {
112+
return new AttributeDefinitionAdapter(element);
113+
}
114+
105115
@Override
106116
public ElementAdapter caseAttributeUsage(AttributeUsage element) {
107117
return new AttributeUsageAdapter(element);
@@ -112,6 +122,11 @@ public ElementAdapter caseBehavior(Behavior element) {
112122
return new BehaviorAdapter(element);
113123
}
114124

125+
@Override
126+
public ElementAdapter caseBindingConnectorAsUsage(BindingConnectorAsUsage element) {
127+
return new BindingConnectorAsUsageAdapter(element);
128+
}
129+
115130
@Override
116131
public ElementAdapter caseBooleanExpression(BooleanExpression element) {
117132
return new BooleanExpressionAdapter(element);
@@ -172,6 +187,11 @@ public ElementAdapter caseConnector(Connector element) {
172187
return new ConnectorAdapter(element);
173188
}
174189

190+
@Override
191+
public ElementAdapter caseConnectorAsUsage(ConnectorAsUsage element) {
192+
return new ConnectorAsUsageAdapter(element);
193+
}
194+
175195
@Override
176196
public ElementAdapter caseConstraintDefinition(ConstraintDefinition element) {
177197
return new ConstraintDefinitionAdapter(element);
@@ -242,6 +262,11 @@ public ElementAdapter caseFeatureInverting(FeatureInverting element) {
242262
return new FeatureInvertingAdapter(element);
243263
}
244264

265+
@Override
266+
public ElementAdapter caseFeatureMembership(FeatureMembership element) {
267+
return new FeatureMembershipAdapter(element);
268+
}
269+
245270
@Override
246271
public ElementAdapter caseFeatureReferenceExpression(FeatureReferenceExpression element) {
247272
return new FeatureReferenceExpressionAdapter(element);
@@ -252,6 +277,11 @@ public ElementAdapter caseFeatureTyping(FeatureTyping element) {
252277
return new FeatureTypingAdapter(element);
253278
}
254279

280+
@Override
281+
public ElementAdapter caseFlowConnectionDefinition(FlowConnectionDefinition element) {
282+
return new FlowConnectionDefinitionAdapter(element);
283+
}
284+
255285
@Override
256286
public ElementAdapter caseFlowConnectionUsage(FlowConnectionUsage element) {
257287
return new FlowConnectionUsageAdapter(element);
@@ -327,11 +357,21 @@ public ElementAdapter caseMembership(Membership element) {
327357
return new MembershipAdapter(element);
328358
}
329359

360+
@Override
361+
public ElementAdapter caseMembershipExpose(MembershipExpose element) {
362+
return new MembershipExposeAdapter(element);
363+
}
364+
330365
@Override
331366
public ElementAdapter caseMembershipImport(MembershipImport element) {
332367
return new MembershipImportAdapter(element);
333368
}
334369

370+
@Override
371+
public ElementAdapter caseMetadataDefinition(MetadataDefinition element) {
372+
return new MetadataDefinitionAdapter(element);
373+
}
374+
335375
@Override
336376
public ElementAdapter caseMetadataFeature(MetadataFeature element) {
337377
return new MetadataFeatureAdapter(element);
@@ -352,6 +392,11 @@ public ElementAdapter caseNamespace(Namespace element) {
352392
return new NamespaceAdapter(element);
353393
}
354394

395+
@Override
396+
public ElementAdapter caseNamespaceExpose(NamespaceExpose element) {
397+
return new NamespaceExposeAdapter(element);
398+
}
399+
355400
@Override
356401
public ElementAdapter caseNamespaceImport(NamespaceImport element) {
357402
return new NamespaceImportAdapter(element);
@@ -467,6 +512,21 @@ public ElementAdapter caseSubsetting(Subsetting element) {
467512
return new SubsettingAdapter(element);
468513
}
469514

515+
@Override
516+
public ElementAdapter caseSuccessionAsUsage(SuccessionAsUsage element) {
517+
return new SuccessionAsUsageAdapter(element);
518+
}
519+
520+
@Override
521+
public ElementAdapter caseSuccessionFlowConnectionUsage(SuccessionFlowConnectionUsage element) {
522+
return new SuccessionFlowConnectionUsageAdapter(element);
523+
}
524+
525+
@Override
526+
public ElementAdapter caseSuccessionItemFlow(SuccessionItemFlow element) {
527+
return new SuccessionItemFlowAdapter(element);
528+
}
529+
470530
@Override
471531
public ElementAdapter caseStateDefinition(StateDefinition element) {
472532
return new StateDefinitionAdapter(element);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2019 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
* Contributors:
21+
* Zoltan Ujhelyi, MDS
22+
*/
23+
24+
package org.omg.sysml.adapter;
25+
26+
import org.omg.sysml.lang.sysml.FeatureMembership;
27+
28+
/**
29+
* This adapter does not introduce any specific behavior compared to the
30+
* {@link MembershipAdapter} but it is introduced to allow unexpected behavior
31+
* changes when regenerating the EMF models (as sometimes the order of multiple
32+
* generalizations changes).
33+
*/
34+
public class FeatureMembershipAdapter extends MembershipAdapter {
35+
36+
public FeatureMembershipAdapter(FeatureMembership element) {
37+
super(element);
38+
}
39+
40+
@Override
41+
public FeatureMembership getTarget() {
42+
return (FeatureMembership)super.getTarget();
43+
}
44+
45+
}

0 commit comments

Comments
 (0)