Skip to content

Commit 93eed1c

Browse files
committed
Issue #4 - First step
- Implemented checking for actual standard steretoype applications, for @create, @destroy and @modellibrary.
1 parent c1390c5 commit 93eed1c

File tree

22 files changed

+84223
-83960
lines changed

22 files changed

+84223
-83960
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
@ModelLibrary
2+
@profile
23
package StandardProfile {
4+
5+
@stereotype(Class)
6+
public class Create { }
7+
8+
@stereotype(Class)
9+
public class Destroy { }
10+
11+
@stereotype(Package)
12+
public class ModelLibrary { }
13+
314
}

org.modeldriven.alf.eclipse/UML/_RunTests.uml

Lines changed: 83862 additions & 83860 deletions
Large diffs are not rendered by default.
3.42 KB
Binary file not shown.

org.modeldriven.alf.eclipse/src/org/modeldriven/alf/eclipse/uml/Element.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2011-2015 Data Access Technologies, Inc. (Model Driven Solutions)
2+
* Copyright 2011-2016 Data Access Technologies, Inc. (Model Driven Solutions)
33
*
44
* All rights reserved worldwide. This program and the accompanying materials
55
* are made available for use under the terms of the GNU General Public License
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
@ModelLibrary
2+
@profile
23
package StandardProfile {
4+
5+
@stereotype(Class)
6+
public class Create { }
7+
8+
@stereotype(Class)
9+
public class Destroy { }
10+
11+
@stereotype(Package)
12+
public class ModelLibrary { }
13+
314
}
3.42 KB
Binary file not shown.

org.modeldriven.alf/src/org/modeldriven/alf/execution/AlfBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
public abstract class AlfBase {
2626

27-
public static final String ALF_VERSION = "0.6.0f";
27+
public static final String ALF_VERSION = "0.6.0g";
2828

2929
protected boolean isVerbose = false;
3030

org.modeldriven.alf/src/org/modeldriven/alf/fuml/mapping/units/NamespaceDefinitionMapping.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public void mapTo(NamedElement namespace) throws MappingError {
6363
// are supported in the target UML implementation. Always ignore
6464
// template parameters (which are handled during classifier mapping).
6565
if ((supportsTemplates || member.getImpl().isCompletelyBound()) &&
66-
!(member instanceof ClassifierTemplateParameter)) {
66+
!(member instanceof ClassifierTemplateParameter) &&
67+
// Ignore stereotypes, which cannot be mapped to fUML.
68+
!member.getImpl().isStereotype()) {
6769
// System.out.println("[mapTo] member=" + member);
6870
FumlMapping mapping = this.fumlMap(getNonfeatureSubunit(member));
6971
for (Element element: mapping.getModelElements()) {

org.modeldriven.alf/src/org/modeldriven/alf/fuml/mapping/units/PackageDefinitionMapping.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ public void mapTo(Package package_) throws MappingError {
6161
if (package_ instanceof Model) {
6262
ElementReference standardProfile = RootNamespace.getRootScope().getStandardProfile();
6363
if (standardProfile != null) {
64-
ProfileApplication profileApplication = this.create(ProfileApplication.class);
65-
profileApplication.setAppliedProfile((Profile)standardProfile.getImpl().getUml());
66-
package_.addProfileApplication(profileApplication);
64+
Profile profile = (Profile)standardProfile.getImpl().getUml();
65+
if (profile != null) {
66+
ProfileApplication profileApplication = this.create(ProfileApplication.class);
67+
profileApplication.setAppliedProfile(profile);
68+
package_.addProfileApplication(profileApplication);
69+
}
6770
}
6871
}
6972

org.modeldriven.alf/src/org/modeldriven/alf/syntax/common/impl/ExternalElementReferenceImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ public String getVisibility() {
403403
@Override
404404
public List<ElementReference> getOwnedMembers() {
405405
List<ElementReference> features = new ArrayList<ElementReference>();
406-
if (this.isClassifier()) {
407-
for (NamedElement member: ((Classifier)this.getSelf().getElement()).getOwnedMember()) {
406+
if (this.isNamespace()) {
407+
for (NamedElement member: ((Namespace)this.getSelf().getElement()).getOwnedMember()) {
408408
features.add(ElementReferenceImpl.makeElementReference(member, this.asNamespace()));
409409
}
410410
}
@@ -414,8 +414,8 @@ public List<ElementReference> getOwnedMembers() {
414414
@Override
415415
public List<ElementReference> getMembers() {
416416
List<ElementReference> features = new ArrayList<ElementReference>();
417-
if (this.isClassifier()) {
418-
for (NamedElement member: ((Classifier)this.getSelf().getElement()).getMember()) {
417+
if (this.isNamespace()) {
418+
for (NamedElement member: ((Namespace)this.getSelf().getElement()).getMember()) {
419419
features.add(ElementReferenceImpl.makeElementReference(member, this.asNamespace()));
420420
}
421421
}

0 commit comments

Comments
 (0)