Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:37:18 +0000
committerCamille Letavernier2014-08-21 11:37:18 +0000
commitea48a20561464c3cbb7895d430583669a9f82fcc (patch)
tree0fdf9eebacbbb301b13bafce3ca4a6952ff6e91c /extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass
parentf91b71175fd97557cf378cdcad845a44a6274b16 (diff)
downloadorg.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.gz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.xz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.zip
[Code style] Apply clean-up and formatter on Extra plug-ins
Diffstat (limited to 'extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java8
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java6
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java8
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/StateMachineUtil.java32
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/TransitionService.java14
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java19
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java15
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java17
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java70
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java77
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java26
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java24
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java67
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java70
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java100
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java58
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java17
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java60
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java40
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java33
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java42
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java51
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java165
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java11
24 files changed, 542 insertions, 488 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java
index 369b1e2591a..d6090837dab 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java
@@ -15,7 +15,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
- public static LogHelper log;
+ public static LogHelper log;
/**
* The constructor
@@ -32,9 +32,9 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
-
+
// register the login helper
- log = new LogHelper(plugin);
+ log = new LogHelper(plugin);
}
/*
@@ -50,7 +50,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java
index ac269c2f4d8..5972200b5ff 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard;
* Copy wizard for the HelloWorld example
*/
public class HelloWorldModelWizard extends ModelCopyWizard {
-
+
public HelloWorldModelWizard() {
super("HelloWorld"); //$NON-NLS-1$
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java
index b27d9463dd2..38ae39a4204 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -20,8 +20,8 @@ import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard;
* Copy wizard for the ProducerConsumer example
*/
public class ProducerConsumerModelWizard extends ModelCopyWizard {
-
- public ProducerConsumerModelWizard () {
+
+ public ProducerConsumerModelWizard() {
super("ProducerConsumer"); //$NON-NLS-1$
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/StateMachineUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/StateMachineUtil.java
index 6c8efd7ce81..52d4c5fcb1c 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/StateMachineUtil.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/StateMachineUtil.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -28,16 +28,17 @@ public class StateMachineUtil {
/**
* Return the bound package in the context of template instantiation for a given actual.
- *
+ *
* This is required by the state machine template which needs to access operation IDs
* provided by the call interceptor.
- *
- * @param actual The actual for template binding
+ *
+ * @param actual
+ * The actual for template binding
* @return
*/
public static Package boundPackageRef(Type actual) {
- for(Package nestedPkg : Utils.getTop(actual).getNestedPackages()) {
- if(nestedPkg.getTemplateBindings().size() > 0) {
+ for (Package nestedPkg : Utils.getTop(actual).getNestedPackages()) {
+ if (nestedPkg.getTemplateBindings().size() > 0) {
TemplateBinding binding = nestedPkg.getTemplateBindings().get(0);
if (actual == TemplateUtils.getFirstActualFromBinding(binding)) {
return nestedPkg;
@@ -46,32 +47,35 @@ public class StateMachineUtil {
}
return null;
}
-
+
/**
* Declares a dependency from the current classifier which is produced by template instantiation
* to the element (enum) "OperationIDs", if found within the passed package.
* Called by Acceleo script "acceptableEvents.mtl".
+ *
* @param pkg
* @return
*/
public static void declareDependencyToOperationIDs(Package pkg) {
PackageableElement type = pkg.getPackagedElement("OperationIDs"); //$NON-NLS-1$
- if(type instanceof Type) {
- UMLTool.declareDependency(TransformationContext.classifier, (Type)type);
+ if (type instanceof Type) {
+ UMLTool.declareDependency(TransformationContext.classifier, (Type) type);
}
}
-
+
/**
* Declares a dependency from the current classifier which is produced by template instantiation
* to the element (enum) "SignalIDs", if found within the passed package.
* Called by Acceleo script "acceptableEvents.mtl".
- * @param pkg the package in which an enumeration is looked up
+ *
+ * @param pkg
+ * the package in which an enumeration is looked up
* @return
*/
public static void declareDependencyToSignalIDs(Package pkg) {
PackageableElement type = pkg.getPackagedElement("SignalIDs"); //$NON-NLS-1$
- if(type instanceof Type) {
- UMLTool.declareDependency(TransformationContext.classifier, (Type)type);
+ if (type instanceof Type) {
+ UMLTool.declareDependency(TransformationContext.classifier, (Type) type);
}
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/TransitionService.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/TransitionService.java
index 25fb4255d55..6ba749d0c45 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/TransitionService.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/acceleo/TransitionService.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -22,7 +22,7 @@ import org.eclipse.uml2.uml.Transition;
/**
* This class encapsulates an <code>org.eclipse.uml2.uml.Transition</code><BR>
- *
+ *
* @author Remi SCHNEKENBURGER
*/
public class TransitionService {
@@ -31,20 +31,20 @@ public class TransitionService {
* Get the transition number within the state machine
* BEWARE: this method works only with Accord|UML compliant State Machines,
* with no parallel processing, i.e. a single region
- *
+ *
* @return Returns the transition number, returns 0 if pb
*/
public int getNumber(Transition transition) {
int nb = 0;
StateMachine stateMachine = transition.containingStateMachine();
EList<Region> SMRegions = stateMachine.getRegions();
- if(SMRegions.size() >= 2) {
+ if (SMRegions.size() >= 2) {
// TODO error message
} else {
Region theRegion = SMRegions.get(0);
- for(Transition currentTrans : theRegion.getTransitions()) {
+ for (Transition currentTrans : theRegion.getTransitions()) {
nb = nb + 1;
- if(currentTrans == transition) {
+ if (currentTrans == transition) {
break;
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java
index 0e6f173894b..1450552c297 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -30,24 +30,25 @@ import org.eclipse.uml2.uml.util.UMLUtil;
/**
* Instantiate (bind Acceleo template) the text within a C++Include stereotype.
- *
+ *
* The actual is the first actual within the template binding. This function does not check
* whether the classifier has the template stereotype.
- *
+ *
* Note: this function is C++ specific, but many parts of the model library are C++ specific as well
- *
+ *
*/
public class BindCppIncludeToFirstActual implements PostCopyListener, IBindingHelper {
+ @Override
public void postCopyEObject(LazyCopier copy, EObject targetEObj) {
// if (copy.get(sourceEObj) isWithinTemplate)
- if(targetEObj instanceof Classifier) {
-
- Classifier targetCl = (Classifier)targetEObj;
+ if (targetEObj instanceof Classifier) {
+
+ Classifier targetCl = (Classifier) targetEObj;
try {
Classifier actual = TemplateUtils.getFirstActualFromBinding(binding);
Include cppInclude = UMLUtil.getStereotypeApplication(targetCl, Include.class);
- if((actual != null) && (cppInclude != null)) {
+ if ((actual != null) && (cppInclude != null)) {
TransformationContext.classifier = targetCl;
String newBody = AcceleoDriverWrapper.evaluate(cppInclude.getBody(), actual, null);
String newPreBody = AcceleoDriverWrapper.evaluate(cppInclude.getPreBody(), actual, null);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java
index c705d243fa0..6b2d352e1ee 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java
@@ -22,23 +22,22 @@ import org.eclipse.uml2.uml.TemplateBinding;
public class BindOperation implements IBindingHelper, PreCopyListener {
private TemplateBinding binding;
-
+
@Override
public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) {
-
- if(sourceEObj instanceof Operation) {
+
+ if (sourceEObj instanceof Operation) {
Operation operation = (Operation) sourceEObj;
Classifier actual = TemplateUtils.getFirstActualFromBinding(binding);
Operation newOperation = BindingUtils.instantiateOperation(copy, actual, operation);
- for(Behavior method : operation.getMethods()) {
- if(method instanceof OpaqueBehavior) {
+ for (Behavior method : operation.getMethods()) {
+ if (method instanceof OpaqueBehavior) {
try {
Behavior newBehavior =
- BindingUtils.instantiateBehavior(copy, actual, (OpaqueBehavior)method);
+ BindingUtils.instantiateBehavior(copy, actual, (OpaqueBehavior) method);
newBehavior.setSpecification(newOperation);
- }
- catch (TransformationException e) {
+ } catch (TransformationException e) {
Activator.log.error(e);
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java
index 4d6fa72e82e..21ea550a898 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -30,25 +30,26 @@ import org.eclipse.uml2.uml.util.UMLUtil;
/**
* Instantiate (bind Acceleo template) the text within a C++Include stereotype.
- *
+ *
* Difference to InstantiateCppInclude: This function does not obtain the actual from a template
* binding. Instead it takes the classifier having the Template stereotype as actual.
* TODO: What's the use of this function. The classifier is known at this time - unless in a template?
- *
+ *
* Note: this function is C++ specific, but many parts of the model library are C++ specific as well
- *
+ *
*/
@Deprecated
public class InstantiateCppIncludeWithItSelf implements PostCopyListener, IBindingHelper {
+ @Override
public void postCopyEObject(LazyCopier copy, EObject targetEObj) {
// if (copy.get(sourceEObj) isWithinTemplate)
- if(targetEObj instanceof Classifier) {
+ if (targetEObj instanceof Classifier) {
// TODO: C++ specific code!
- Classifier targetCl = (Classifier)targetEObj;
+ Classifier targetCl = (Classifier) targetEObj;
Template template = UMLUtil.getStereotypeApplication(targetCl, Template.class);
// apply, in case of pass-classifier
- if((template != null) && (template.getHelper() == null)) {
+ if ((template != null) && (template.getHelper() == null)) {
try {
Include cppInclude = UMLUtil.getStereotypeApplication(targetCl, Include.class);
TransformationContext.classifier = targetCl;
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java
index f4d28c0d966..f641819fc6b 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -43,36 +43,37 @@ import org.eclipse.uml2.uml.Type;
public class LoopOperations implements IBindingHelper, PreCopyListener {
private TemplateBinding binding;
-
+
+ @Override
public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) {
-
- if(sourceEObj instanceof Operation) {
- Operation operation = (Operation)sourceEObj;
+
+ if (sourceEObj instanceof Operation) {
+ Operation operation = (Operation) sourceEObj;
Classifier actual = TemplateUtils.getFirstActualFromBinding(binding);
-
- if(!(actual instanceof Interface)) {
+
+ if (!(actual instanceof Interface)) {
return sourceEObj;
}
- Interface passedActualIntf = (Interface)actual;
+ Interface passedActualIntf = (Interface) actual;
Operation last = null;
EList<Element> removalList = new BasicEList<Element>();
- for(Operation intfOperation : passedActualIntf.getAllOperations()) {
- for(Element removalElement : removalList) {
+ for (Operation intfOperation : passedActualIntf.getAllOperations()) {
+ for (Element removalElement : removalList) {
copy.removeForCopy(removalElement); // enable subsequent instantiations
}
removalList.clear();
last = BindingUtils.instantiateOperation(copy, intfOperation, operation);
removalList.add(operation);
- for(Behavior method : operation.getMethods()) {
- if(method instanceof OpaqueBehavior) {
+ for (Behavior method : operation.getMethods()) {
+ if (method instanceof OpaqueBehavior) {
try {
Behavior newBehavior =
- BindingUtils.instantiateBehavior(copy, intfOperation, (OpaqueBehavior)method);
+ BindingUtils.instantiateBehavior(copy, intfOperation, (OpaqueBehavior) method);
newBehavior.setSpecification(last);
- }
- catch (TransformationException e) {
- Activator.log.error(e);;
+ } catch (TransformationException e) {
+ Activator.log.error(e);
+ ;
}
// removalList.add(method);
copy.removeForCopy(method); // enable subsequent instantiations
@@ -84,36 +85,35 @@ public class LoopOperations implements IBindingHelper, PreCopyListener {
copy.put(operation, last);
return last;
/*
- else { // not LOOP_OPERATIONS
- Operation newOperation = instantiateOperation(actual, template, operation, boundClass);
- for(Behavior method : operation.getMethods()) {
- if(method instanceof OpaqueBehavior) {
- Behavior newBehavior =
- instantiateBehavior(actual, template, (OpaqueBehavior)method);
- newBehavior.setSpecification(newOperation);
- }
- }
- return newOperation;
- */
+ * else { // not LOOP_OPERATIONS
+ * Operation newOperation = instantiateOperation(actual, template, operation, boundClass);
+ * for(Behavior method : operation.getMethods()) {
+ * if(method instanceof OpaqueBehavior) {
+ * Behavior newBehavior =
+ * instantiateBehavior(actual, template, (OpaqueBehavior)method);
+ * newBehavior.setSpecification(newOperation);
+ * }
+ * }
+ * return newOperation;
+ */
}
- else if(sourceEObj instanceof EnumerationLiteral) {
- EnumerationLiteral literal = (EnumerationLiteral)sourceEObj;
+ else if (sourceEObj instanceof EnumerationLiteral) {
+ EnumerationLiteral literal = (EnumerationLiteral) sourceEObj;
Classifier actual = TemplateUtils.getFirstActualFromBinding(binding);
// Type passedActual = getPassedActual(template, actual, boundClass);
Type passedActual = actual;
- if(!(passedActual instanceof Interface)) {
+ if (!(passedActual instanceof Interface)) {
return sourceEObj;
}
- Interface passedActualIntf = (Interface)passedActual;
+ Interface passedActualIntf = (Interface) passedActual;
EnumerationLiteral newLiteral = null;
- for(Operation intfOperation : passedActualIntf.getAllOperations()) {
+ for (Operation intfOperation : passedActualIntf.getAllOperations()) {
copy.removeForCopy(literal);
newLiteral = copy.getCopy(literal);
try {
String newName = AcceleoDriverWrapper.evaluate(literal.getName(), intfOperation, null);
newLiteral.setName(newName);
- }
- catch (TransformationException e) {
+ } catch (TransformationException e) {
Activator.log.error(e);
newLiteral.setName("none"); //$NON-NLS-1$
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java
index fee1ebd2e98..e76e284f645 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -32,63 +32,64 @@ import org.eclipse.uml2.uml.util.UMLUtil;
*/
// @unused
public class AccordCall extends ConnectorTypeUtil {
-
- private ConnectableElement clientRole = null ;
- private ConnectableElement serverRole = null ;
- private ConnectableElement rtuRole = null ;
- private ConnectableElement connectorRole = null ;
-
+
+ private ConnectableElement clientRole = null;
+ private ConnectableElement serverRole = null;
+ private ConnectableElement rtuRole = null;
+ private ConnectableElement connectorRole = null;
+
+ @Override
public FCMUtil.RoleBindingTable getRoleBindings(Connector connector) {
- super.getRoleBindings(connector) ;
-
- clientRole = bindingTable.getRoleKeyByName("client") ;
- serverRole = bindingTable.getRoleKeyByName("server") ;
- rtuRole = bindingTable.getRoleKeyByName("rtu") ;
- connectorRole = bindingTable.getRoleKeyByName("connector") ;
-
+ super.getRoleBindings(connector);
+
+ clientRole = bindingTable.getRoleKeyByName("client");
+ serverRole = bindingTable.getRoleKeyByName("server");
+ rtuRole = bindingTable.getRoleKeyByName("rtu");
+ connectorRole = bindingTable.getRoleKeyByName("connector");
+
for (org.eclipse.uml2.uml.ConnectorEnd end : connector.getBase_Connector().getEnds()) {
if (end.getRole() instanceof org.eclipse.uml2.uml.Port) {
- org.eclipse.uml2.uml.Port port = (org.eclipse.uml2.uml.Port)end.getRole() ;
- org.eclipse.uml2.uml.Property part = end.getPartWithPort() ;
+ org.eclipse.uml2.uml.Port port = (org.eclipse.uml2.uml.Port) end.getRole();
+ org.eclipse.uml2.uml.Property part = end.getPartWithPort();
if (StereotypeUtil.isApplied(port, org.eclipse.papyrus.FCM.Port.class)) {
org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class);
if (fcmPort.getKind().getBase_Class().getName().equals("UseInterfaceWithRtf")) {
// => elements associated with the connector end play the client role
- List<NamedElement> clientActors = new ArrayList<NamedElement>() ;
- clientActors.add(port) ;
- clientActors.add(part) ;
- bindingTable.addEntry(clientRole, clientActors) ;
+ List<NamedElement> clientActors = new ArrayList<NamedElement>();
+ clientActors.add(port);
+ clientActors.add(part);
+ bindingTable.addEntry(clientRole, clientActors);
}
else if (fcmPort.getKind().getBase_Class().getName().equals("ProvideInterface")) {
// => elements associated with the connector end play the server role
- List<NamedElement> serverActors = new ArrayList<NamedElement>() ;
- serverActors.add(port) ;
- serverActors.add(part) ;
- bindingTable.addEntry(serverRole, serverActors) ;
+ List<NamedElement> serverActors = new ArrayList<NamedElement>();
+ serverActors.add(port);
+ serverActors.add(part);
+ bindingTable.addEntry(serverRole, serverActors);
// the property playing the server role must also play the rtu role
- port = ((org.eclipse.uml2.uml.Class)part.getType()).getOwnedPort("rtu", null) ;
+ port = ((org.eclipse.uml2.uml.Class) part.getType()).getOwnedPort("rtu", null);
if (port == null) {
- if (((org.eclipse.uml2.uml.Class)part.getType()).getInheritedMember("rtu") != null &&
- ((org.eclipse.uml2.uml.Class)part.getType()).getInheritedMember("rtu") instanceof org.eclipse.uml2.uml.Port) {
- port = (org.eclipse.uml2.uml.Port)((org.eclipse.uml2.uml.Class)part.getType()).getInheritedMember("rtu") ;
+ if (((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu") != null &&
+ ((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu") instanceof org.eclipse.uml2.uml.Port) {
+ port = (org.eclipse.uml2.uml.Port) ((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu");
}
else {
- System.out.println("Could not find a port rtu on part " + part.getName() + " : " + part.getType()) ;
+ System.out.println("Could not find a port rtu on part " + part.getName() + " : " + part.getType());
}
}
if (port != null) {
- List<NamedElement> rtuActors = new ArrayList<NamedElement>() ;
- rtuActors.add(port) ;
- rtuActors.add(part) ;
- bindingTable.addEntry(rtuRole, rtuActors) ;
+ List<NamedElement> rtuActors = new ArrayList<NamedElement>();
+ rtuActors.add(port);
+ rtuActors.add(part);
+ bindingTable.addEntry(rtuRole, rtuActors);
}
}
}
}
}
- List<NamedElement> connectorActors = new ArrayList<NamedElement>() ;
- connectorActors.add(connector.getBase_Connector()) ;
- bindingTable.addEntry(connectorRole, connectorActors) ;
- return bindingTable ;
+ List<NamedElement> connectorActors = new ArrayList<NamedElement>();
+ connectorActors.add(connector.getBase_Connector());
+ bindingTable.addEntry(connectorRole, connectorActors);
+ return bindingTable;
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java
index 5ac32b50f4e..b33d4053ed2 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -27,9 +27,9 @@ import org.eclipse.uml2.uml.Property;
* portID attribute of the call event interceptor. The interceptor uses this
* attribute to initialize the portID attribute within the produced CallEvent
* data structure.
- *
+ *
* @author ansgar
- *
+ *
*/
public class AnimServiceConfigurator implements IInstanceConfigurator {
@@ -38,17 +38,17 @@ public class AnimServiceConfigurator implements IInstanceConfigurator {
/**
* Configure the instance of a CallEvent interceptor. The configuration parameter is the
* index of the port which gets intercepted. It is obtained via an enumeration
- *
- * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification,
- * org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port)
- *
+ *
+ * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port)
+ *
* @param instance
- * the instance that should be configured
+ * the instance that should be configured
* @param componentPart
- * the part representing this instance
+ * the part representing this instance
* @param context
- * container context
+ * container context
*/
+ @Override
public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance)
{
EList<InstanceSpecification> nodes = AllocUtils.getAllNodesOrThreadsParent(parentInstance);
@@ -58,11 +58,11 @@ public class AnimServiceConfigurator implements IInstanceConfigurator {
// option: explicitly pre-create singletons (and allocate these?)
NamedElement animService = node.getNearestPackage().getMember(eclipseAnimService);
if (animService instanceof InstanceSpecification) {
- AllocUtils.allocate(instance, (InstanceSpecification)animService);
+ AllocUtils.allocate(instance, (InstanceSpecification) animService);
return;
}
}
- // throw new TransformationRTException(String.format("Cannot find node <%s> in platform definition", eclipseAnimService));
+ // throw new TransformationRTException(String.format("Cannot find node <%s> in platform definition", eclipseAnimService));
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java
index ca3a437adb0..db9831cd43a 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -24,9 +24,9 @@ import org.eclipse.uml2.uml.Property;
* portID attribute of the call event interceptor. The interceptor uses this
* attribute to initialize the portID attribute within the produced CallEvent
* data structure.
- *
+ *
* @author ansgar
- *
+ *
*/
public class CallEventConfigurator implements IInstanceConfigurator {
@@ -35,20 +35,20 @@ public class CallEventConfigurator implements IInstanceConfigurator {
/**
* Configure the instance of a CallEvent interceptor. The configuration parameter is the
* index of the port which gets intercepted. It is obtained via an enumeration
- *
- * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification,
- * org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port)
- *
+ *
+ * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port)
+ *
* @param instance
- * the instance that should be configured
+ * the instance that should be configured
* @param componentPart
- * the part representing this instance
+ * the part representing this instance
* @param context
- * container context
+ * container context
*/
+ @Override
public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance)
{
- if(parentInstance != null) {
+ if (parentInstance != null) {
// make sure that there is an enum par port
// String literalName = "port_" + UMLTool.varName(context.port); //$NON-NLS-1$
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java
index 05c33faa99d..5af90bf2266 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java
@@ -14,37 +14,39 @@ import org.eclipse.uml2.uml.Type;
public class AMIcallback implements IMappingRule {
+ @Override
public Interface getProvided(Port p, boolean update) {
Type type = p.getBase_Port().getType();
- if(!(type instanceof Interface))
+ if (!(type instanceof Interface)) {
return null;
+ }
- Interface typingInterface = (Interface)type;
+ Interface typingInterface = (Interface) type;
Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_reply_", type, update);
if (!update) {
return derivedInterface;
}
- for(Operation operation : typingInterface.getOwnedOperations()) {
+ for (Operation operation : typingInterface.getOwnedOperations()) {
String name = operation.getName();
- if(AMIpoll.hasOutParameters(operation)) {
+ if (AMIpoll.hasOutParameters(operation)) {
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(name, null, null);
}
- // each non-in parameter is in the poll operation.
- for(Parameter parameter : operation.getOwnedParameters()) {
- if(parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) {
+ // each non-in parameter is in the poll operation.
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) {
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if(derivedOperation.getOwnedParameter(paramName, paramType) == null) {
+ if (derivedOperation.getOwnedParameter(paramName, paramType) == null) {
Parameter newParameter =
- derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
+ derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
newParameter.setDirection(ParameterDirectionKind.IN_LITERAL);
newParameter.setLower(parameter.getLower());
newParameter.setUpper(parameter.getUpper());
@@ -54,11 +56,11 @@ public class AMIcallback implements IMappingRule {
// remove those parameters that exist in derived, but not original interface.
Iterator<Parameter> derivedParameters = derivedOperation.getOwnedParameters().iterator();
- while(derivedParameters.hasNext()) {
+ while (derivedParameters.hasNext()) {
Parameter parameter = derivedParameters.next();
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if(operation.getOwnedParameter(paramName, paramType) == null) {
+ if (operation.getOwnedParameter(paramName, paramType) == null) {
// not on in original interface, remove from derived as well
derivedParameters.remove();
}
@@ -69,13 +71,13 @@ public class AMIcallback implements IMappingRule {
// check whether operations in derived interface exist in original interface
// (remove, if not)
Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations().iterator();
- while(derivedOperations.hasNext()) {
+ while (derivedOperations.hasNext()) {
Operation derivedOperation = derivedOperations.next();
String name = derivedOperation.getName();
- if(name == null) {
+ if (name == null) {
continue;
}
- if(typingInterface.getOperation(name, null, null) == null) {
+ if (typingInterface.getOperation(name, null, null) == null) {
// not in typing interface, remove
derivedOperations.remove();
}
@@ -83,36 +85,38 @@ public class AMIcallback implements IMappingRule {
return derivedInterface;
}
+ @Override
public Interface getRequired(Port p, boolean update) {
Type type = p.getBase_Port().getType();
- if(!(type instanceof Interface))
+ if (!(type instanceof Interface)) {
return null;
+ }
- Interface typingInterface = (Interface)type;
+ Interface typingInterface = (Interface) type;
Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_req_", type, update); //$NON-NLS-1$
if (!update) {
return derivedInterface;
}
- for(Operation operation : typingInterface.getOwnedOperations()) {
+ for (Operation operation : typingInterface.getOwnedOperations()) {
String name = operation.getName();
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(name, null, null);
}
- // request operation contains only in and inout parameters
- for(Parameter parameter : operation.getOwnedParameters()) {
- if((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) ||
- (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) {
+ // request operation contains only in and inout parameters
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ if ((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) ||
+ (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) {
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if(derivedOperation.getOwnedParameter(paramName, paramType) == null) {
+ if (derivedOperation.getOwnedParameter(paramName, paramType) == null) {
Parameter newParameter =
- derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
+ derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
newParameter.setDirection(parameter.getDirection());
newParameter.setLower(parameter.getLower());
newParameter.setUpper(parameter.getUpper());
@@ -122,11 +126,11 @@ public class AMIcallback implements IMappingRule {
// remove those parameters that exist in derived, but not original interface.
Iterator<Parameter> derivedParameters = derivedOperation.getOwnedParameters().iterator();
- while(derivedParameters.hasNext()) {
+ while (derivedParameters.hasNext()) {
Parameter parameter = derivedParameters.next();
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if(operation.getOwnedParameter(paramName, paramType) == null) {
+ if (operation.getOwnedParameter(paramName, paramType) == null) {
// not on in original interface, remove from derived as well
derivedParameters.remove();
}
@@ -136,13 +140,13 @@ public class AMIcallback implements IMappingRule {
// check whether operations in derived interface exist in original interface
// (remove, if not)
Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations().iterator();
- while(derivedOperations.hasNext()) {
+ while (derivedOperations.hasNext()) {
Operation derivedOperation = derivedOperations.next();
String name = derivedOperation.getName();
- if(name == null) {
+ if (name == null) {
continue;
}
- if(typingInterface.getOperation(name, null, null) == null) {
+ if (typingInterface.getOperation(name, null, null) == null) {
// not in typing interface, remove
derivedOperations.remove();
}
@@ -150,7 +154,8 @@ public class AMIcallback implements IMappingRule {
return derivedInterface;
}
-
+
+ @Override
public boolean needsUpdate(Port p) {
// TODO: insufficient condition
return (getRequired(p, false) == null) ||
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java
index 53e395b0077..256e0d883e1 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -31,58 +31,61 @@ import org.eclipse.uml2.uml.Type;
* This is defined in the CORBA 3 standard in section 22.6.2
* A difference is that we do not return the poller object, but the client uses the original port.
* This has the consequence that it is not possible to make multiple asynchronous requests.
- *
+ *
* A second difference is that we do not keep the normal methods in the same interface and prefix the
* new ones. (which would probably be a good idea).
- *
+ *
* @author ansgar
- *
+ *
*/
public class AMIpoll implements IMappingRule {
+ @Override
public Interface getProvided(Port p, boolean update) {
return null;
}
+ @Override
public Interface getRequired(Port p, boolean update) {
Type type = p.getBase_Port().getType();
- if(!(type instanceof Interface))
+ if (!(type instanceof Interface)) {
return null;
+ }
- Interface typingInterface = (Interface)type;
+ Interface typingInterface = (Interface) type;
Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_", type, update); //$NON-NLS-1$
if (!update) {
return derivedInterface;
}
-
- for(Operation operation : typingInterface.getOwnedOperations()) {
+
+ for (Operation operation : typingInterface.getOwnedOperations()) {
String name = operation.getName();
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(name, null, null);
}
- if(hasOutParameters(operation)) {
+ if (hasOutParameters(operation)) {
String pollName = name + "Poll"; //$NON-NLS-1$
Operation derivedPollOperation = derivedInterface.getOperation(pollName, null, null);
- if(derivedPollOperation == null) {
+ if (derivedPollOperation == null) {
derivedPollOperation = derivedInterface.createOwnedOperation(pollName, null, null);
}
- // each non-in parameter is in the poll operation.
+ // each non-in parameter is in the poll operation.
derivedPollOperation.createOwnedParameter("timeout", null); //$NON-NLS-1$
- for(Parameter parameter : operation.getOwnedParameters()) {
- if(parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) {
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) {
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if(derivedPollOperation.getOwnedParameter(paramName, paramType) == null) {
+ if (derivedPollOperation.getOwnedParameter(paramName, paramType) == null) {
Parameter newParameter =
- derivedPollOperation.createOwnedParameter(parameter.getName(), parameter.getType());
+ derivedPollOperation.createOwnedParameter(parameter.getName(), parameter.getType());
newParameter.setDirection(parameter.getDirection());
newParameter.setLower(parameter.getLower());
newParameter.setUpper(parameter.getUpper());
@@ -90,16 +93,16 @@ public class AMIpoll implements IMappingRule {
}
}
}
- // each in and inout parameter is in the request operation.
- for(Parameter parameter : operation.getOwnedParameters()) {
- if((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) ||
- (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) {
+ // each in and inout parameter is in the request operation.
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ if ((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) ||
+ (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) {
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if(derivedOperation.getOwnedParameter(paramName, paramType) == null) {
+ if (derivedOperation.getOwnedParameter(paramName, paramType) == null) {
Parameter newParameter =
- derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
+ derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
newParameter.setDirection(parameter.getDirection());
newParameter.setLower(parameter.getLower());
newParameter.setUpper(parameter.getUpper());
@@ -108,12 +111,12 @@ public class AMIpoll implements IMappingRule {
}
// remove those parameters that exist in derived, but not original interface.
Iterator<Parameter> derivedParameters = derivedOperation.getOwnedParameters().iterator();
- while(derivedParameters.hasNext()) {
+ while (derivedParameters.hasNext()) {
Parameter parameter = derivedParameters.next();
String paramName = parameter.getName();
Type paramType = parameter.getType();
- if((!paramName.equals("timeout")) && //$NON-NLS-1$
- (operation.getOwnedParameter(paramName, paramType) == null)) {
+ if ((!paramName.equals("timeout")) && //$NON-NLS-1$
+ (operation.getOwnedParameter(paramName, paramType) == null)) {
// not on in original interface, remove from derived as well
derivedParameters.remove();
}
@@ -123,17 +126,17 @@ public class AMIpoll implements IMappingRule {
// check whether operations in derived interface exist in original interface
// (remove, if not)
Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations().iterator();
- while(derivedOperations.hasNext()) {
+ while (derivedOperations.hasNext()) {
Operation derivedOperation = derivedOperations.next();
String name = derivedOperation.getName();
- if(name == null) {
+ if (name == null) {
continue;
}
- if(name.endsWith("Poll")) { //$NON-NLS-1$
+ if (name.endsWith("Poll")) { //$NON-NLS-1$
// remove Poll postfix
name = name.substring(0, name.length() - 4);
}
- if(typingInterface.getOperation(name, null, null) == null) {
+ if (typingInterface.getOperation(name, null, null) == null) {
// not in typing interface, remove
derivedOperations.remove();
}
@@ -143,14 +146,15 @@ public class AMIpoll implements IMappingRule {
}
public static boolean hasOutParameters(Operation operation) {
- for(Parameter parameter : operation.getOwnedParameters()) {
- if(parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) {
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) {
return true;
}
}
return false;
}
-
+
+ @Override
public boolean needsUpdate(Port p) {
// TODO: insufficient condition
return (getRequired(p, false) == null);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java
index 12cf4ecdf68..1edf8442cbe 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -32,75 +32,77 @@ import org.eclipse.uml2.uml.Type;
* type. Since the component typing the port can have multiple provided and required
* ports, the ports are implicitly owned by the port. Conjugation on the level of an extended
* port level will conjugate all ports of the component typing the port.
- *
+ *
* The derived interface that is provided will concatenate provided port names within the
* extended port with the port name and provided a "big" interface.
* The derived interface that is required is identical, except for a conjugation on the
* extended port level.
- *
+ *
* Creates a fixed template binding that binds T (of the extended Port) to the used data type
- *
+ *
* Here, the idea is that the port type is a classifier, e.g. the data type that is
* transported by a DDS port. The port kind is the extended port, e.g. DDSWrite.
- *
+ *
* The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one
* port
- *
- * TODO: This class has become obsolete now, since extended DDS ports are now supported via flattening
- *
+ *
+ * TODO: This class has become obsolete now, since extended DDS ports are now supported via flattening
+ *
* @author ansgar
- *
+ *
*/
@Deprecated
public class ExtendedPort implements IMappingRule {
public static final String PROV_PREFIX = "P_"; //$NON-NLS-1$
-
+
public static final String REQ_PREFIX = "R_"; //$NON-NLS-1$
-
+
+ @Override
public Interface getProvided(org.eclipse.papyrus.FCM.Port p, boolean update)
{
return null;
// return getDerived(p, false, config, update);
}
+ @Override
public Interface getRequired(org.eclipse.papyrus.FCM.Port p, boolean update)
{
return null;
// return getDerived(p, true, config, update);
}
+ @Override
public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) {
- return
- needsUpdate(p, false) ||
- needsUpdate(p, true);
+ return needsUpdate(p, false) ||
+ needsUpdate(p, true);
}
-
+
public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p, boolean isRequired) {
Type type = p.getBase_Port().getType();
- if(!(type instanceof Classifier)) {
+ if (!(type instanceof Classifier)) {
return false;
}
Class extendedPort = p.getKind().getBase_Class();
String prefix = extendedPort.getName() + "_" + (isRequired ? REQ_PREFIX : PROV_PREFIX); //$NON-NLS-1$
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, prefix, type, false);
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
return true;
}
- for(Port port : extendedPort.getOwnedPorts()) {
+ for (Port port : extendedPort.getOwnedPorts()) {
Interface derivedIntf = (isRequired) ?
- PortUtils.getRequired(port) :
- PortUtils.getProvided(port);
+ PortUtils.getRequired(port) :
+ PortUtils.getProvided(port);
- if(derivedIntf != null) {
- for(Operation op : derivedIntf.getAllOperations()) {
+ if (derivedIntf != null) {
+ for (Operation op : derivedIntf.getAllOperations()) {
String name = port.getName() + "_" + op.getName(); //$NON-NLS-1$
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
return true;
}
else {
@@ -113,11 +115,11 @@ public class ExtendedPort implements IMappingRule {
}
return false;
}
-
+
public Interface getDerived(org.eclipse.papyrus.FCM.Port extPort, boolean isRequired, InstanceSpecification config, boolean update)
{
Type type = extPort.getBase_Port().getType();
- if(!(type instanceof Classifier)) {
+ if (!(type instanceof Classifier)) {
return null;
}
Class extendedPort = extPort.getKind().getBase_Class();
@@ -127,41 +129,41 @@ public class ExtendedPort implements IMappingRule {
if (!update) {
return derivedInterface;
}
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
return null;
}
/*
- TemplateSignature signature = TemplateUtils.getSignature(type.getNearestPackage());
- if(signature != null) {
- Package model = Utils.getTop(derivedInterface);
- try {
- TemplateBinding binding =
- TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type);
- Copy copy = new Copy(model, model, false);
- TemplateInstantiation ti = new TemplateInstantiation(copy, binding);
- // create a bound element of the extended port. Add bound class to derived interface class
- Class boundClass = ti.bindNamedElement(extendedPort);
- derivedInterface.getNearestPackage().getPackagedElements().add(boundClass);
- } catch (TransformationException e) {
- return null;
- }
- }
- */
+ * TemplateSignature signature = TemplateUtils.getSignature(type.getNearestPackage());
+ * if(signature != null) {
+ * Package model = Utils.getTop(derivedInterface);
+ * try {
+ * TemplateBinding binding =
+ * TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type);
+ * Copy copy = new Copy(model, model, false);
+ * TemplateInstantiation ti = new TemplateInstantiation(copy, binding);
+ * // create a bound element of the extended port. Add bound class to derived interface class
+ * Class boundClass = ti.bindNamedElement(extendedPort);
+ * derivedInterface.getNearestPackage().getPackagedElements().add(boundClass);
+ * } catch (TransformationException e) {
+ * return null;
+ * }
+ * }
+ */
// obtain first template parameter = port type
// kind.getBase_Class().getNearestPackage().getTemplateParameter();
- for(Port port : extendedPort.getOwnedPorts()) {
+ for (Port port : extendedPort.getOwnedPorts()) {
Interface derivedIntf = (isRequired) ?
- PortUtils.getRequired(port) :
- PortUtils.getProvided(port);
+ PortUtils.getRequired(port) :
+ PortUtils.getProvided(port);
- if(derivedIntf != null) {
- for(Operation op : derivedIntf.getAllOperations()) {
+ if (derivedIntf != null) {
+ for (Operation op : derivedIntf.getAllOperations()) {
String name = port.getName() + "_" + op.getName(); //$NON-NLS-1$
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(name, null, null);
OperationUtils.syncOperation(op, derivedOperation);
derivedOperation.setName(name);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java
index 2ade40bc014..e449b289aa7 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -31,28 +31,30 @@ import org.eclipse.uml2.uml.Type;
* the port can have multiple provided and required
* ports, the ports are implicitly owned by the port. Conjugation on the level of an extended
* port level will conjugate all ports of the component typing the port.
- *
+ *
* The derived interface that is provided will allow a caller to access individual ports. It
* is therefore a reference to the interfaces get_<portName> operations provided by a
* component.
* The derived interface that is required is identical, except for a conjugation on the
* extended port level.
- *
+ *
* What is the difference to ExtendedPort?
- *
+ *
*/
public class ExtendedPort2 implements IMappingRule {
public static final String CONJ_PREFIX = "C2_"; //$NON-NLS-1$
-
+
public static final String NORM_PREFIX = "N2_"; //$NON-NLS-1$
-
+
+ @Override
public Interface getProvided(org.eclipse.papyrus.FCM.Port p, boolean update)
{
return getDerived(p, p.getBase_Port().isConjugated(), update);
}
+ @Override
public Interface getRequired(org.eclipse.papyrus.FCM.Port p, boolean update)
{
return getDerived(p, !p.getBase_Port().isConjugated(), update);
@@ -61,69 +63,71 @@ public class ExtendedPort2 implements IMappingRule {
public Interface getDerived(org.eclipse.papyrus.FCM.Port extPort, boolean isConjugated, boolean update)
{
Type type = extPort.getBase_Port().getType();
- if(!(type instanceof Class))
+ if (!(type instanceof Class)) {
return null;
+ }
- Class extendedPort = (Class)type;
+ Class extendedPort = (Class) type;
String prefix = isConjugated ? CONJ_PREFIX : NORM_PREFIX;
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(extPort, prefix, type, update);
if (!update) {
return derivedInterface;
}
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
return null;
}
- for(Port port : extendedPort.getOwnedPorts()) {
+ for (Port port : extendedPort.getOwnedPorts()) {
// if the extended port is conjugated, each of the provided/required are (implicitly)
// conjugated [TODO: is PortUtils aware of it? - probably yes]
Interface provIntf = (isConjugated) ?
- PortUtils.getRequired(port) :
- PortUtils.getProvided(port);
+ PortUtils.getRequired(port) :
+ PortUtils.getProvided(port);
- if(provIntf != null) {
+ if (provIntf != null) {
String name = PrefixConstants.getP_Prefix + port.getName();
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(name, null, null);
}
}
}
return derivedInterface;
}
-
+
+ @Override
public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) {
- return
- needsUpdate(p, false) ||
- needsUpdate(p, true);
+ return needsUpdate(p, false) ||
+ needsUpdate(p, true);
}
public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p, boolean isConjugated) {
Type type = p.getBase_Port().getType();
- if(!(type instanceof Class))
+ if (!(type instanceof Class)) {
return false;
+ }
- Class extendedPort = (Class)type;
+ Class extendedPort = (Class) type;
String prefix = isConjugated ? CONJ_PREFIX : NORM_PREFIX;
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, prefix, type, false);
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
return true;
}
- for(Port port : extendedPort.getOwnedPorts()) {
+ for (Port port : extendedPort.getOwnedPorts()) {
// if the extended port is conjugated, each of the provided/required are (implicitly)
// conjugated [TODO: is PortUtils aware of it? - probably yes]
Interface provIntf = (isConjugated) ?
- PortUtils.getRequired(port) :
- PortUtils.getProvided(port);
+ PortUtils.getRequired(port) :
+ PortUtils.getProvided(port);
- if(provIntf != null) {
+ if (provIntf != null) {
String name = PrefixConstants.getP_Prefix + port.getName();
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(name, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
return true;
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java
index cf1ebdd664e..94c6afe39bd 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -21,18 +21,21 @@ import org.eclipse.uml2.uml.Type;
public class ProvideInterface implements IMappingRule
{
- public Interface getProvided (Port p, boolean update) {
- Type type = p.getBase_Port ().getType ();
+ @Override
+ public Interface getProvided(Port p, boolean update) {
+ Type type = p.getBase_Port().getType();
if (type instanceof Interface) {
return ((Interface) type);
}
return null;
}
-
- public Interface getRequired (Port p, boolean update) {
+
+ @Override
+ public Interface getRequired(Port p, boolean update) {
return null;
}
-
+
+ @Override
public boolean needsUpdate(Port p) {
return false;
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java
index 0010236de70..50164caa7c0 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java
@@ -1,19 +1,20 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
package org.eclipse.papyrus.qompass.modellibs.core.mappingrules;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.EList;
import org.eclipse.papyrus.FCM.Port;
@@ -41,109 +42,112 @@ public class PullConsumer implements IMappingRule {
public static String PULL_I_PREFIX = "PullConsumer_"; //$NON-NLS-1$
public static String PULL_OP_NAME = "pull"; //$NON-NLS-1$
-
+
public static String HASDATA_OP_NAME = "hasData"; //$NON-NLS-1$
-
+
public static String RET_PAR_NAME = "ret"; //$NON-NLS-1$
-
+
public static String BOOL_QNAME = "corba::Boolean"; //$NON-NLS-1$
+ @Override
public Interface getProvided(Port p, boolean update) {
return null;
}
+ @Override
public boolean needsUpdate(Port p) {
Type type = p.getBase_Port().getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, PULL_I_PREFIX, type, false);
if (derivedInterface == null) {
return true;
}
Operation derivedOperation = derivedInterface.getOperation(PULL_OP_NAME, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
return true;
}
EList<Parameter> parameters = derivedOperation.getOwnedParameters();
- if(parameters.size() != 1) {
+ if (parameters.size() != 1) {
return true;
} else {
Parameter parameter = parameters.get(0);
- if(!parameter.getName().equals(RET_PAR_NAME)) {
+ if (!parameter.getName().equals(RET_PAR_NAME)) {
return true;
}
- if(parameter.getType() != type) {
+ if (parameter.getType() != type) {
return true;
}
}
}
return false;
}
-
+
public static PullConsumer getInstance() {
- if(instance == null) {
+ if (instance == null) {
instance = new PullConsumer();
}
return instance;
}
+ @Override
public Interface getRequired(Port p, boolean update) {
org.eclipse.uml2.uml.Port umlPort = p.getBase_Port();
Element owner = umlPort.getOwner();
String ownerStr = ""; //$NON-NLS-1$
- if(owner instanceof NamedElement) {
- ownerStr = " of class " + ((NamedElement)owner).getQualifiedName(); //$NON-NLS-1$
+ if (owner instanceof NamedElement) {
+ ownerStr = " of class " + ((NamedElement) owner).getQualifiedName(); //$NON-NLS-1$
}
- Log.log(Status.INFO, Log.CALC_PORTKIND,
- p.getKind().getBase_Class().getName() + " => GetRequired on " + umlPort.getName() + ownerStr);
+ Log.log(IStatus.INFO, Log.CALC_PORTKIND,
+ p.getKind().getBase_Class().getName() + " => GetRequired on " + umlPort.getName() + ownerStr);
Type type = umlPort.getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, PULL_I_PREFIX, type, update);
if (!update) {
return derivedInterface;
}
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
return null;
}
// check whether operation already exists. Create, if not
Operation derivedOperationPull = derivedInterface.getOperation(PULL_OP_NAME, null, null);
- if(derivedOperationPull == null) {
+ if (derivedOperationPull == null) {
derivedOperationPull = derivedInterface.createOwnedOperation(PULL_OP_NAME, null, null, type);
}
EList<Parameter> parameters = derivedOperationPull.getOwnedParameters();
- if(parameters.size() > 0) {
+ if (parameters.size() > 0) {
Parameter parameter = parameters.get(0);
- if((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) {
+ if ((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) {
parameter.setName(RET_PAR_NAME);
}
- if(parameter.getType() != type) {
+ if (parameter.getType() != type) {
parameter.setType(type);
}
}
Package model = Utils.getTop(umlPort);
Element element = Utils.getQualifiedElement(model, BOOL_QNAME);
Type booleanType = null;
- if(element instanceof Type) {
- booleanType = (Type)element;
+ if (element instanceof Type) {
+ booleanType = (Type) element;
}
// check whether operation already exists. Create, if not
Operation derivedOperationHasData = derivedInterface.getOperation(HASDATA_OP_NAME, null, null);
- if(derivedOperationHasData == null) {
+ if (derivedOperationHasData == null) {
derivedOperationHasData = derivedInterface.createOwnedOperation(HASDATA_OP_NAME, null, null, booleanType);
}
parameters = derivedOperationHasData.getOwnedParameters();
- if(parameters.size() > 0) {
+ if (parameters.size() > 0) {
Parameter parameter = parameters.get(0);
- if((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) {
+ if ((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) {
parameter.setName(RET_PAR_NAME);
}
- if((booleanType != null) && (parameter.getType() != booleanType)) {
+ if ((booleanType != null) && (parameter.getType() != booleanType)) {
// added != null check
parameter.setType(booleanType);
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java
index 00038d17216..396d2676ee6 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java
@@ -1,19 +1,20 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
package org.eclipse.papyrus.qompass.modellibs.core.mappingrules;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.EList;
import org.eclipse.papyrus.FCM.Port;
@@ -31,9 +32,9 @@ import org.eclipse.uml2.uml.Type;
/**
* Will generate a suitable called interface push consumer. The port is typed with a primitive type
* or data type. The generated interface has a "push (data <Type>)" operation ).
- *
+ *
* The interface is identical to that of a PushProducer (and will be shared).
- *
+ *
* @author ansgar
*/
public class PushConsumer implements IMappingRule {
@@ -41,62 +42,64 @@ public class PushConsumer implements IMappingRule {
public static String PUSH_I_PREFIX = "Push_"; //$NON-NLS-1$
public static String PUSH_OP_PREFIX = "push"; //$NON-NLS-1$
-
+
public static String PUSH_OP_PARNAME = "data"; //$NON-NLS-1$
+ @Override
public boolean needsUpdate(Port p) {
Type type = p.getBase_Port().getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, PUSH_I_PREFIX, type, false);
if (derivedInterface == null) {
return true;
}
Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_PREFIX, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
return true;
}
EList<Parameter> parameters = derivedOperation.getOwnedParameters();
- if(parameters.size() != 1) {
+ if (parameters.size() != 1) {
return true;
} else {
Parameter parameter = parameters.get(0);
- if(!parameter.getName().equals(PUSH_OP_PARNAME)) {
+ if (!parameter.getName().equals(PUSH_OP_PARNAME)) {
return true;
}
- if(parameter.getType() != type) {
+ if (parameter.getType() != type) {
return true;
}
}
}
return false;
}
-
+
+ @Override
public Interface getProvided(Port p, boolean update) {
- Log.log(Status.INFO, Log.CALC_PORTKIND,
- p.getKind().getBase_Class().getName() + " => GetProvided on " + p.getBase_Port().getName());
+ Log.log(IStatus.INFO, Log.CALC_PORTKIND,
+ p.getKind().getBase_Class().getName() + " => GetProvided on " + p.getBase_Port().getName());
Type type = p.getBase_Port().getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, PUSH_I_PREFIX, type, update);
if (!update) {
return derivedInterface;
}
-
- if(derivedInterface == null) {
+
+ if (derivedInterface == null) {
// may happen, if within template (do not want creation of derived interfaces in template)
return null;
}
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_PREFIX, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(PUSH_OP_PREFIX, null, null);
}
EList<Parameter> parameters = derivedOperation.getOwnedParameters();
- if(parameters.size() == 0) {
+ if (parameters.size() == 0) {
derivedOperation.createOwnedParameter(PUSH_OP_PARNAME, type);
} else {
parameters.get(0).setName(PUSH_OP_PARNAME);
@@ -108,6 +111,7 @@ public class PushConsumer implements IMappingRule {
}
}
+ @Override
public Interface getRequired(Port p, boolean update) {
return null;
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
index 50f65037250..00aa083a8bb 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
@@ -1,19 +1,20 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
package org.eclipse.papyrus.qompass.modellibs.core.mappingrules;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.papyrus.FCM.Port;
import org.eclipse.papyrus.FCM.util.IMappingRule;
@@ -30,27 +31,29 @@ import org.eclipse.uml2.uml.Type;
/**
* Will generate a suitable callable interface pulling consumer. The port is typed with a primitive type
* or data type. The generated interface has a "<Type> pull as well as a "boolean hasData ()" operation).
- *
+ *
* @author ansgar
*/
public class PushProdPullCons implements IMappingRule {
+ @Override
public Interface getProvided(Port p, boolean update) {
return null;
}
+ @Override
public Interface getRequired(Port p, boolean update) {
org.eclipse.uml2.uml.Port umlPort = p.getBase_Port();
Element owner = umlPort.getOwner();
String ownerStr = ""; //$NON-NLS-1$
- if(owner instanceof NamedElement) {
- ownerStr = " of class " + ((NamedElement)owner).getQualifiedName(); //$NON-NLS-1$
+ if (owner instanceof NamedElement) {
+ ownerStr = " of class " + ((NamedElement) owner).getQualifiedName(); //$NON-NLS-1$
}
- Log.log(Status.INFO, Log.CALC_PORTKIND,
- p.getKind().getBase_Class().getName() + " => GetRequired on " + umlPort.getName() + ownerStr);
+ Log.log(IStatus.INFO, Log.CALC_PORTKIND,
+ p.getKind().getBase_Class().getName() + " => GetRequired on " + umlPort.getName() + ownerStr);
Type type = umlPort.getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_", type, update); //$NON-NLS-1$
if (!update) {
@@ -61,14 +64,14 @@ public class PushProdPullCons implements IMappingRule {
// name of the port kind attached to port "p" which would produce wrong results.
Interface derivedInterfacePushProd = PushProducer.getInstance().getRequired(p, update);
Interface derivedInterfacePullCons = PullConsumer.getInstance().getRequired(p, update);
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
return null;
}
- if(!derivedInterface.getGenerals().contains(derivedInterfacePushProd)) {
+ if (!derivedInterface.getGenerals().contains(derivedInterfacePushProd)) {
derivedInterface.createGeneralization(derivedInterfacePushProd);
}
- if(!derivedInterface.getGenerals().contains(derivedInterfacePullCons)) {
+ if (!derivedInterface.getGenerals().contains(derivedInterfacePullCons)) {
derivedInterface.createGeneralization(derivedInterfacePullCons);
}
return derivedInterface;
@@ -77,10 +80,10 @@ public class PushProdPullCons implements IMappingRule {
return null;
}
}
-
+
+ @Override
public boolean needsUpdate(Port p) {
- return
- PushProducer.getInstance().needsUpdate(p) ||
- PullConsumer.getInstance().needsUpdate(p);
+ return PushProducer.getInstance().needsUpdate(p) ||
+ PullConsumer.getInstance().needsUpdate(p);
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java
index b1087f22120..22a277fce3f 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java
@@ -1,19 +1,20 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
package org.eclipse.papyrus.qompass.modellibs.core.mappingrules;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.EList;
import org.eclipse.papyrus.FCM.Port;
@@ -31,9 +32,9 @@ import org.eclipse.uml2.uml.Type;
/**
* Will generate a suitable callable interface push provider. The port is typed with a primitive type
* or data type. The generated interface has a "push (data <Type>)" operation
- *
+ *
* The interface is identical to that of a PushConsumer (and will be shared).
- *
+ *
* @author ansgar
*/
public class PushProducer implements IMappingRule {
@@ -41,78 +42,81 @@ public class PushProducer implements IMappingRule {
public static String PUSH_I_PREFIX = "Push_"; //$NON-NLS-1$
public static String PUSH_OP_NAME = "push"; //$NON-NLS-1$
-
+
public static String PUSH_OP_PARNAME = "data"; //$NON-NLS-1$
+ @Override
public Interface getProvided(Port p, boolean update) {
return null;
}
public static PushProducer getInstance() {
- if(instance == null) {
+ if (instance == null) {
instance = new PushProducer();
}
return instance;
}
+ @Override
public boolean needsUpdate(Port p) {
Type type = p.getBase_Port().getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, PUSH_I_PREFIX, type, false);
if (derivedInterface == null) {
return true;
}
Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_NAME, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
return true;
}
EList<Parameter> parameters = derivedOperation.getOwnedParameters();
- if(parameters.size() != 1) {
+ if (parameters.size() != 1) {
return true;
} else {
Parameter parameter = parameters.get(0);
- if(!parameter.getName().equals(PUSH_OP_PARNAME)) {
+ if (!parameter.getName().equals(PUSH_OP_PARNAME)) {
return true;
}
- if(parameter.getType() != type) {
+ if (parameter.getType() != type) {
return true;
}
}
}
return false;
}
-
+
+ @Override
public Interface getRequired(Port p, boolean update) {
- Log.log(Status.INFO, Log.CALC_PORTKIND, p.getKind().getBase_Class().getName() + " => GetRequired on " + p.getBase_Port().getName());
+ Log.log(IStatus.INFO, Log.CALC_PORTKIND, p.getKind().getBase_Class().getName() + " => GetRequired on " + p.getBase_Port().getName());
Type type = p.getBase_Port().getType();
- if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
+ if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(p, PUSH_I_PREFIX, type, update);
if (!update) {
return derivedInterface;
}
- if(derivedInterface == null) {
+ if (derivedInterface == null) {
// may happen, if within template (do not want creation of derived interfaces in template)
return null;
}
// check whether operation already exists. Create, if not
Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_NAME, null, null);
- if(derivedOperation == null) {
+ if (derivedOperation == null) {
derivedOperation = derivedInterface.createOwnedOperation(PUSH_OP_NAME, null, null);
}
EList<Parameter> parameters = derivedOperation.getOwnedParameters();
- if(parameters.size() == 0) {
+ if (parameters.size() == 0) {
derivedOperation.createOwnedParameter(PUSH_OP_PARNAME, type);
} else {
Parameter parameter = parameters.get(0);
- if(!parameter.getName().equals(PUSH_OP_PARNAME)) {
+ if (!parameter.getName().equals(PUSH_OP_PARNAME)) {
parameter.setName(PUSH_OP_PARNAME);
}
- if(parameter.getType() != type) {
+ if (parameter.getType() != type) {
parameter.setType(type);
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java
index dfae71fc195..e4dd3ebb7fd 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -41,40 +41,43 @@ import org.eclipse.uml2.uml.util.UMLUtil;
* type. Since the component typing the port can have multiple provided and required
* ports, the ports are implicitly owned by the port. Conjugation on the level of an extended
* port level will conjugate all ports of the component typing the port.
- *
+ *
* The derived interface that is provided will concatenate provided port names within the
* extended port with the port name and provided a "big" interface.
* The derived interface that is required is identical, except for a conjugation on the
* extended port level.
- *
+ *
* Creates a fixed template binding that binds T (of the extended Port) to the used data type
- *
+ *
* Here, the idea is that the port type is a classifier, e.g. the data type that is
* transported by a DDS port. The port kind is the extended port, e.g. DDSWrite.
- *
+ *
* The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one
* port
- *
+ *
* @author ansgar
- *
+ *
*/
public class TemplatePort implements ITemplateMappingRule {
+ @Override
public Interface getProvided(org.eclipse.papyrus.FCM.Port p, boolean update)
{
return null;
}
+ @Override
public Interface getRequired(org.eclipse.papyrus.FCM.Port p, boolean update)
{
return null;
}
+ @Override
public PortKind getBoundType(org.eclipse.papyrus.FCM.Port p)
{
Port port = p.getBase_Port();
Type type = port.getType();
- if(!(type instanceof Classifier)) {
+ if (!(type instanceof Classifier)) {
return null;
}
if (p.getKind() == null) {
@@ -83,14 +86,14 @@ public class TemplatePort implements ITemplateMappingRule {
Class extendedPort = p.getKind().getBase_Class();
TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage());
Package pkgTemplate = signature.getNearestPackage();
- if(pkgTemplate != null) {
+ if (pkgTemplate != null) {
EList<Namespace> path = TemplateUtils.relativePathWithMerge(extendedPort, pkgTemplate);
-
- String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$
+
+ String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$
Package model = Utils.getTop(port);
Package pkg = model.getNestedPackage(name);
if (pkg == null) {
- model = Utils.getFirstLevel(port); // try whether package template exists here
+ model = Utils.getFirstLevel(port); // try whether package template exists here
// required for target model with additional "root" folder
pkg = model.getNestedPackage(name);
}
@@ -110,25 +113,26 @@ public class TemplatePort implements ITemplateMappingRule {
return null;
}
+ @Override
public void updateBinding(org.eclipse.papyrus.FCM.Port p) {
Port port = p.getBase_Port();
Type type = port.getType();
- if(!(type instanceof Classifier)) {
+ if (!(type instanceof Classifier)) {
return;
}
Class extendedPort = p.getKind().getBase_Class();
TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage());
- if(signature != null) {
+ if (signature != null) {
Package model = Utils.getTop(port);
try {
TemplateBinding binding =
- TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type);
+ TemplateUtils.fixedBinding(model, extendedPort, (Classifier) type);
LazyCopier copy = new LazyCopier(model, model, false, true);
TemplateInstantiation ti = new TemplateInstantiation(copy, binding);
// remove listener synchronizing implementation, since it would add derived
// elements for the extended port itself (e.g. provided operations)
- if(copy.postCopyListeners.contains(FixTemplateSync.getInstance())) {
+ if (copy.postCopyListeners.contains(FixTemplateSync.getInstance())) {
copy.postCopyListeners.remove(FixTemplateSync.getInstance());
}
@@ -138,11 +142,12 @@ public class TemplatePort implements ITemplateMappingRule {
}
}
}
-
+
+ @Override
public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) {
Port port = p.getBase_Port();
Type type = port.getType();
- if(!(type instanceof Classifier)) {
+ if (!(type instanceof Classifier)) {
return false;
}
if (p.getKind() == null) {
@@ -151,14 +156,14 @@ public class TemplatePort implements ITemplateMappingRule {
Class extendedPort = p.getKind().getBase_Class();
TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage());
Package pkgTemplate = signature.getNearestPackage();
- if(pkgTemplate != null) {
+ if (pkgTemplate != null) {
EList<Namespace> path = TemplateUtils.relativePathWithMerge(extendedPort, pkgTemplate);
-
- String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$
+
+ String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$
Package model = Utils.getTop(port);
Package pkg = model.getNestedPackage(name);
if (pkg == null) {
- model = Utils.getFirstLevel(port); // try whether package template exists here
+ model = Utils.getFirstLevel(port); // try whether package template exists here
// required for target model with additional "root" folder
pkg = model.getNestedPackage(name);
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java
index 996a13cd457..ba1c62097fc 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -38,138 +38,145 @@ import org.eclipse.uml2.uml.Type;
*
*/
public class UseConjIntf implements IMappingRule {
-
- public Interface getProvided (Port p, boolean update) {
+
+ @Override
+ public Interface getProvided(Port p, boolean update) {
return null;
- }
-
- public Interface getRequired (Port p, boolean update) {
- Type type = p.getBase_Port ().getType ();
- if (!(type instanceof Interface)) return null;
-
+ }
+
+ @Override
+ public Interface getRequired(Port p, boolean update) {
+ Type type = p.getBase_Port().getType();
+ if (!(type instanceof Interface)) {
+ return null;
+ }
+
Interface typingInterface = (Interface) type;
- Interface derivedInterface = MapUtil.getOrCreateDerivedInterface (p, "_", type, update); //$NON-NLS-1$
+ Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_", type, update); //$NON-NLS-1$
if (!update) {
return derivedInterface;
}
if (derivedInterface == null) {
return null;
}
- for (Operation operation : typingInterface.getOwnedOperations ()) {
- String name = operation.getName ();
-
+ for (Operation operation : typingInterface.getOwnedOperations()) {
+ String name = operation.getName();
+
// check whether operation already exists. Create, if not
- Operation derivedOperation = derivedInterface.getOperation (name, null, null);
+ Operation derivedOperation = derivedInterface.getOperation(name, null, null);
if (derivedOperation == null) {
- derivedOperation = derivedInterface.createOwnedOperation (name, null, null);
+ derivedOperation = derivedInterface.createOwnedOperation(name, null, null);
}
-
+
// TODO: move to Copy (factor code, ensure that these values are handled in case of model copies ...)
- derivedOperation.setIsAbstract (operation.isAbstract ());
- derivedOperation.setIsStatic (operation.isStatic ()); // (does not make sense for an interface, if true)
- derivedOperation.setIsUnique (operation.isUnique ());
- derivedOperation.setIsQuery (operation.isQuery ());
-
- for (Parameter parameter : operation.getOwnedParameters ()) {
- String paramName = parameter.getName ();
- Type paramType = parameter.getType ();
- if (derivedOperation.getOwnedParameter (paramName, paramType) == null) {
+ derivedOperation.setIsAbstract(operation.isAbstract());
+ derivedOperation.setIsStatic(operation.isStatic()); // (does not make sense for an interface, if true)
+ derivedOperation.setIsUnique(operation.isUnique());
+ derivedOperation.setIsQuery(operation.isQuery());
+
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ String paramName = parameter.getName();
+ Type paramType = parameter.getType();
+ if (derivedOperation.getOwnedParameter(paramName, paramType) == null) {
Parameter newParameter =
- derivedOperation.createOwnedParameter(parameter.getName (), parameter.getType ());
- ParameterDirectionKind direction = parameter.getDirection ();
+ derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType());
+ ParameterDirectionKind direction = parameter.getDirection();
if (direction == ParameterDirectionKind.IN_LITERAL) {
- newParameter.setDirection (ParameterDirectionKind.OUT_LITERAL);
+ newParameter.setDirection(ParameterDirectionKind.OUT_LITERAL);
}
else if (direction == ParameterDirectionKind.OUT_LITERAL) {
- newParameter.setDirection (ParameterDirectionKind.IN_LITERAL);
+ newParameter.setDirection(ParameterDirectionKind.IN_LITERAL);
}
else {
- newParameter.setDirection (direction);
+ newParameter.setDirection(direction);
}
- newParameter.setLower (parameter.getLower ());
- newParameter.setUpper (parameter.getUpper ());
+ newParameter.setLower(parameter.getLower());
+ newParameter.setUpper(parameter.getUpper());
}
}
// remove those parameters that exist in derived, but not original interface.
- Iterator <Parameter> derivedParameters = derivedOperation.getOwnedParameters ().iterator ();
- while (derivedParameters.hasNext ()) {
- Parameter parameter = derivedParameters.next ();
- String paramName = parameter.getName ();
- Type paramType = parameter.getType ();
- if (operation.getOwnedParameter (paramName, paramType) == null) {
+ Iterator<Parameter> derivedParameters = derivedOperation.getOwnedParameters().iterator();
+ while (derivedParameters.hasNext()) {
+ Parameter parameter = derivedParameters.next();
+ String paramName = parameter.getName();
+ Type paramType = parameter.getType();
+ if (operation.getOwnedParameter(paramName, paramType) == null) {
// not on in original interface, remove from derived as well
- derivedParameters.remove ();
+ derivedParameters.remove();
}
}
}
-
+
// check whether operations in derived interface exist in original interface
// (remove, if not)
- Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations ().iterator ();
- while (derivedOperations.hasNext ()) {
- Operation derivedOperation = derivedOperations.next ();
- String name = derivedOperation.getName ();
- if (typingInterface.getOperation (name, null, null) == null) {
+ Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations().iterator();
+ while (derivedOperations.hasNext()) {
+ Operation derivedOperation = derivedOperations.next();
+ String name = derivedOperation.getName();
+ if (typingInterface.getOperation(name, null, null) == null) {
// not in typing interface, remove
- if (derivedInterface.getOperations ().remove (derivedOperation)) {
- derivedOperations = derivedInterface.getOwnedOperations ().iterator ();
+ if (derivedInterface.getOperations().remove(derivedOperation)) {
+ derivedOperations = derivedInterface.getOwnedOperations().iterator();
}
}
}
return derivedInterface;
}
-
+
+ @Override
public boolean needsUpdate(Port p) {
- Type type = p.getBase_Port ().getType ();
- if (!(type instanceof Interface)) return false;
-
+ Type type = p.getBase_Port().getType();
+ if (!(type instanceof Interface)) {
+ return false;
+ }
+
Interface typingInterface = (Interface) type;
- Interface derivedInterface = MapUtil.getOrCreateDerivedInterface (p, "_", type, false); //$NON-NLS-1$
+ Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_", type, false); //$NON-NLS-1$
if (derivedInterface == null) {
return true;
}
- for (Operation operation : typingInterface.getOwnedOperations ()) {
- String name = operation.getName ();
-
+ for (Operation operation : typingInterface.getOwnedOperations()) {
+ String name = operation.getName();
+
// check whether operation already exists. Create, if not
- Operation derivedOperation = derivedInterface.getOperation (name, null, null);
+ Operation derivedOperation = derivedInterface.getOperation(name, null, null);
if (derivedOperation == null) {
return true;
}
-
+
// TODO: move to Copy (factor code, ensure that these values are handled in case of model copies ...)
- derivedOperation.setIsAbstract (operation.isAbstract ());
- derivedOperation.setIsStatic (operation.isStatic ()); // (does not make sense for an interface, if true)
- derivedOperation.setIsUnique (operation.isUnique ());
- derivedOperation.setIsQuery (operation.isQuery ());
-
- for (Parameter parameter : operation.getOwnedParameters ()) {
- String paramName = parameter.getName ();
- Type paramType = parameter.getType ();
- if (derivedOperation.getOwnedParameter (paramName, paramType) == null) {
+ derivedOperation.setIsAbstract(operation.isAbstract());
+ derivedOperation.setIsStatic(operation.isStatic()); // (does not make sense for an interface, if true)
+ derivedOperation.setIsUnique(operation.isUnique());
+ derivedOperation.setIsQuery(operation.isQuery());
+
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ String paramName = parameter.getName();
+ Type paramType = parameter.getType();
+ if (derivedOperation.getOwnedParameter(paramName, paramType) == null) {
return true;
}
}
// remove those parameters that exist in derived, but not original interface.
- Iterator <Parameter> derivedParameters = derivedOperation.getOwnedParameters ().iterator ();
- while (derivedParameters.hasNext ()) {
- Parameter parameter = derivedParameters.next ();
- String paramName = parameter.getName ();
- Type paramType = parameter.getType ();
- if (operation.getOwnedParameter (paramName, paramType) == null) {
+ Iterator<Parameter> derivedParameters = derivedOperation.getOwnedParameters().iterator();
+ while (derivedParameters.hasNext()) {
+ Parameter parameter = derivedParameters.next();
+ String paramName = parameter.getName();
+ Type paramType = parameter.getType();
+ if (operation.getOwnedParameter(paramName, paramType) == null) {
// not on in original operation
return true;
}
}
}
-
+
// check whether operations in derived interface exist in original interface
// (remove, if not)
- Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations ().iterator ();
- while (derivedOperations.hasNext ()) {
- Operation derivedOperation = derivedOperations.next ();
- String name = derivedOperation.getName ();
- if (typingInterface.getOperation (name, null, null) == null) {
+ Iterator<Operation> derivedOperations = derivedInterface.getOwnedOperations().iterator();
+ while (derivedOperations.hasNext()) {
+ Operation derivedOperation = derivedOperations.next();
+ String name = derivedOperation.getName();
+ if (typingInterface.getOperation(name, null, null) == null) {
// not in typing interface
return true;
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java
index cdfd548867f..23947f5472e 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
*
*****************************************************************************/
@@ -22,20 +22,23 @@ import org.eclipse.uml2.uml.Type;
public class UseInterface implements IMappingRule
{
+ @Override
public Interface getProvided(Port p, boolean update)
{
return null;
}
-
+
+ @Override
public Interface getRequired(Port p, boolean update)
{
- Type type = p.getBase_Port ().getType ();
+ Type type = p.getBase_Port().getType();
if (type instanceof Interface) {
return ((Interface) type);
}
return null;
}
+ @Override
public boolean needsUpdate(Port p) {
return false;
}

Back to the top