Skip to content

Commit

Permalink
Fixes Measurable Attribute Export
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebrosse committed Apr 21, 2022
1 parent 1a3af45 commit 19f8602
Show file tree
Hide file tree
Showing 6 changed files with 1,151 additions and 2,481 deletions.
3,514 changes: 1,091 additions & 2,423 deletions src/main/conf/module.xml

Large diffs are not rendered by default.

Binary file modified src/main/conf/res/generated/patterns/framework.umlt
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.modelio.api.module.context.IModuleContext;
import org.modelio.metamodel.uml.infrastructure.ModelTree;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.infrastructure.TagType;
import org.modelio.metamodel.uml.statik.Package;
import org.modelio.vcore.smkernel.mapi.MObject;
import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory;
import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule;
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement;
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.Feature;
import fr.softeam.cameldesigner.api.camelcore.standard.class_.AttributeClass;
import fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttributeClass;
Expand All @@ -36,19 +42,6 @@
import fr.softeam.cameldesigner.api.typemodel.standard.package_.TypeModel;
import fr.softeam.cameldesigner.api.unitmodel.standard.package_.UnitModel;
import fr.softeam.cameldesigner.impl.CamelDesignerModule;
import org.modelio.api.modelio.model.IModelingSession;
import org.modelio.api.modelio.model.PropertyConverter;
import org.modelio.api.module.context.IModuleContext;
import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException;
import org.modelio.metamodel.uml.infrastructure.Dependency;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.metamodel.uml.infrastructure.ModelTree;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.infrastructure.TagType;
import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition;
import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition;
import org.modelio.metamodel.uml.statik.Package;
import org.modelio.vcore.smkernel.mapi.MObject;

/**
* Proxy class to handle a {@link Package} with << Feature_Package >> stereotype.
Expand All @@ -64,7 +57,7 @@ public abstract class FeaturePackage extends Feature {
* Tells whether a {@link FeaturePackage proxy} can be instantiated from a {@link MObject} checking it is a {@link Package} stereotyped << Feature_Package >>.
* <p>
* The method returns <code>false</code> if the instantiation cannot be carried out.
*
*
* @param elt a model object
* @return <code>true</code> if the instantiation can be carried out else <code>false</code>.
*/
Expand Down Expand Up @@ -136,7 +129,7 @@ public List<AttributeClass> getAttributes() {

/**
* Get the underlying {@link Package}.
*
*
* @return the Package represented by this proxy, never null.
*/
@objid ("7ab59d08-1a68-48d0-9fe1-562cb5f08bbd")
Expand Down Expand Up @@ -200,6 +193,14 @@ public List<FeaturePackage> getSubFeatures() {
return Collections.unmodifiableList(results);
}

@Override
public List<CamelElement> getChilds() {
List<CamelElement> result = new ArrayList<>();
result.addAll(super.getChilds());
result.addAll(getAttributes());
return result;
}

@objid ("032316ff-60a6-4503-b2db-431f420860ea")
@Override
public int hashCode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
package fr.softeam.cameldesigner.api.camelcore.standard.package_;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Objects;
import java.util.List;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory;
import org.modelio.api.module.context.IModuleContext;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.infrastructure.TagType;
import org.modelio.metamodel.uml.statik.Package;
import org.modelio.vcore.smkernel.mapi.MObject;
import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule;
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement;
import fr.softeam.cameldesigner.api.constraintmodel.standard.package_.ConstraintModel;
import fr.softeam.cameldesigner.api.datamodel.standard.package_.DataModel;
import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentModel;
Expand All @@ -26,18 +30,6 @@
import fr.softeam.cameldesigner.api.typemodel.standard.package_.TypeModel;
import fr.softeam.cameldesigner.api.unitmodel.standard.package_.UnitModel;
import fr.softeam.cameldesigner.impl.CamelDesignerModule;
import org.modelio.api.modelio.model.IModelingSession;
import org.modelio.api.modelio.model.PropertyConverter;
import org.modelio.api.module.context.IModuleContext;
import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException;
import org.modelio.metamodel.uml.infrastructure.Dependency;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.infrastructure.TagType;
import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition;
import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition;
import org.modelio.metamodel.uml.statik.Package;
import org.modelio.vcore.smkernel.mapi.MObject;

/**
* Proxy class to handle a {@link Package} with << SubModel >> stereotype.
Expand All @@ -53,7 +45,7 @@ public abstract class SubModel extends FeaturePackage {
* Tells whether a {@link SubModel proxy} can be instantiated from a {@link MObject} checking it is a {@link Package} stereotyped << SubModel >>.
* <p>
* The method returns <code>false</code> if the instantiation cannot be carried out.
*
*
* @param elt a model object
* @return <code>true</code> if the instantiation can be carried out else <code>false</code>.
*/
Expand All @@ -79,6 +71,13 @@ public static SubModel instantiate(final Package obj) {
UnitModel.canInstantiate(obj) ? UnitModel.instantiate(obj) : null;
}

@Override
public List<CamelElement> getChilds() {
List<CamelElement> result = new ArrayList<>();
result.addAll(super.getChilds());
return result;
}

@objid ("308c5d47-d90e-4926-9428-2f3daa76a5f9")
@Override
public boolean equals(final Object obj) {
Expand All @@ -97,7 +96,7 @@ public boolean equals(final Object obj) {

/**
* Get the underlying {@link Package}.
*
*
* @return the Package represented by this proxy, never null.
*/
@objid ("223df6df-6562-40e0-b621-b8a5a6057c6f")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
package fr.softeam.cameldesigner.exchange.exporter;

import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.modelio.metamodel.mda.ModuleComponent;
import org.modelio.metamodel.uml.infrastructure.Dependency;
import org.modelio.metamodel.uml.infrastructure.Element;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.statik.Artifact;
import org.modelio.metamodel.uml.statik.Attribute;
import org.modelio.metamodel.uml.statik.AttributeLink;
import org.modelio.metamodel.uml.statik.Class;
import org.modelio.metamodel.uml.statik.Component;
import org.modelio.metamodel.uml.statik.Connector;
import org.modelio.metamodel.uml.statik.DataType;
import org.modelio.metamodel.uml.statik.Enumeration;
import org.modelio.metamodel.uml.statik.GeneralClass;
import org.modelio.metamodel.uml.statik.Instance;
import org.modelio.metamodel.uml.statik.Package;
import org.modelio.metamodel.uml.statik.Port;
import org.modelio.metamodel.visitors.IDefaultInfrastructureVisitor;
import org.modelio.metamodel.visitors.IDefaultModelVisitor;
import org.modelio.metamodel.visitors.IInfrastructureVisitor;
import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule;
import fr.softeam.cameldesigner.exchange.exporter.core.AttributeAttributeExporter;
import fr.softeam.cameldesigner.exchange.exporter.core.AttributeClassExporter;
import fr.softeam.cameldesigner.exchange.exporter.core.FeatureClassExporter;
import fr.softeam.cameldesigner.exchange.exporter.core.FeatureInstanceExporter;
import fr.softeam.cameldesigner.exchange.exporter.core.FeaturePortExporter;
import fr.softeam.cameldesigner.exchange.exporter.core.MeasurableAttributeClassExporter;
import fr.softeam.cameldesigner.exchange.exporter.data.DataExporter;
import fr.softeam.cameldesigner.exchange.exporter.data.DataInstanceExporter;
import fr.softeam.cameldesigner.exchange.exporter.data.DataInstanceModelExporter;
Expand Down Expand Up @@ -124,26 +145,6 @@
import fr.softeam.cameldesigner.exchange.exporter.security.SecuritySLOExporter;
import fr.softeam.cameldesigner.exchange.exporter.type.TypeModelExporter;
import fr.softeam.cameldesigner.exchange.exporter.unit.UnitModelExporter;
import org.modelio.metamodel.mda.ModuleComponent;
import org.modelio.metamodel.uml.infrastructure.Dependency;
import org.modelio.metamodel.uml.infrastructure.Element;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.statik.Artifact;
import org.modelio.metamodel.uml.statik.Attribute;
import org.modelio.metamodel.uml.statik.AttributeLink;
import org.modelio.metamodel.uml.statik.Class;
import org.modelio.metamodel.uml.statik.Component;
import org.modelio.metamodel.uml.statik.Connector;
import org.modelio.metamodel.uml.statik.DataType;
import org.modelio.metamodel.uml.statik.Enumeration;
import org.modelio.metamodel.uml.statik.GeneralClass;
import org.modelio.metamodel.uml.statik.Instance;
import org.modelio.metamodel.uml.statik.Package;
import org.modelio.metamodel.uml.statik.Port;
import org.modelio.metamodel.visitors.IDefaultInfrastructureVisitor;
import org.modelio.metamodel.visitors.IDefaultModelVisitor;
import org.modelio.metamodel.visitors.IInfrastructureVisitor;

/**
* Factory that instantiates the right exporter class for a model element stereotyped by a 'CamelDesigner' module stereotype.
Expand All @@ -157,7 +158,7 @@ public class ExporterFactory {
* Instantiates the right proxy class the given element.
* <br/>The model element must be stereotyped by a 'CamelDesigner' module stereotype.
* <br/>In the other case the method will return <i>null</i>.
*
*
* @param e A model element
* @return the right proxy or <i>null</i>.
*/
Expand All @@ -176,7 +177,7 @@ public static final Object instantiateExporter(final ModelElement e) {
* Instantiates the right proxy class the given element with a stereotype name.
* The stereotype must be one of the 'CamelDesigner' module stereotypes.
* In the other case the method will return <i>null</i>.
*
*
* @param e A model element.
* @param stName A stereotype name.
* @return the right proxy or <i>null</i>.
Expand Down Expand Up @@ -255,6 +256,7 @@ public final Object visitClass(Class obj) {
switch (this.stName) {
case fr.softeam.cameldesigner.api.camelcore.standard.class_.AttributeClass.STEREOTYPE_NAME: return new AttributeClassExporter<>(fr.softeam.cameldesigner.api.camelcore.standard.class_.AttributeClass.instantiate(obj));
case fr.softeam.cameldesigner.api.camelcore.standard.class_.FeatureClass.STEREOTYPE_NAME: return new FeatureClassExporter<>(fr.softeam.cameldesigner.api.camelcore.standard.class_.FeatureClass.instantiate(obj));
case fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttributeClass.STEREOTYPE_NAME: return new MeasurableAttributeClassExporter<>(fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttributeClass.instantiate(obj));
case fr.softeam.cameldesigner.api.datamodel.standard.class_.Data.STEREOTYPE_NAME: return new DataExporter<>(fr.softeam.cameldesigner.api.datamodel.standard.class_.Data.instantiate(obj));
case fr.softeam.cameldesigner.api.datamodel.standard.class_.DataSource.STEREOTYPE_NAME: return new DataSourceExporter<>(fr.softeam.cameldesigner.api.datamodel.standard.class_.DataSource.instantiate(obj));
case fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet.STEREOTYPE_NAME: return new RequirementSetExporter<>(fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet.instantiate(obj));
Expand Down Expand Up @@ -466,7 +468,7 @@ public final Object visitPort(Port obj) {
/**
* Get the visitor to delegate to when a {@link IInfrastructureVisitor} is needed.
* <p>If null is returned the caller will return null.
*
*
* @return the {@link IInfrastructureVisitor} visitor or <i>null</i>.
*/
@objid ("811fd899-8f65-4257-b11f-cffff1d5ef23")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import org.eclipse.emf.cdo.CDOObject;

@objid ("1e3affd3-a822-46b9-9f98-e4c113b6f02f")
public class MeasurableAttributeExporter<T extends MeasurableAttributeClass> extends CamelAttributeExporter<T> {
public class MeasurableAttributeClassExporter<T extends MeasurableAttributeClass> extends CamelAttributeExporter<T> {
@objid ("f26414ea-1ff1-419c-b922-2d0bdbfea187")
public MeasurableAttributeExporter(T elt) {
public MeasurableAttributeClassExporter(T elt) {
super(elt);
}

Expand Down

0 comments on commit 19f8602

Please sign in to comment.