...
 
Commits (9)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: UML-SIF
Bundle-SymbolicName: org.codeling.lang.uml-sif;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Marco Konersmann <marco.konersmann@paluno.uni-due.de>
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: org.codeling.core;bundle-version="1.0.0",
org.eclipse.emf.ecore,
org.codeling.utils,
org.eclipse.osgi;bundle-version="3.12.0",
org.eclipse.core.runtime;bundle-version="3.13.0",
org.codeling.ial.mm,
org.eclipse.uml2.uml
source.. = src/main/java,src/main/resources/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.codeling.languageRegistry">
<specificationLanguageDefinition
languageDefinitionClass="org.codeling.lang.uml.sif.UMLLanguageDefinition"
name="UML-SIF"
symbolicName="uml-sif"
version="1.0">
</specificationLanguageDefinition>
</extension>
</plugin>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codeling</groupId>
<artifactId>org.codeling.lang.uml-sif</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Codeling UML Model Transformation with Secure Information Flow (SIF)</name>
<properties>
<tycho.version>1.0.0</tycho.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compiler-version>1.8</compiler-version>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<finalName>${project.artifactId}-${project.version}-${sha1}</finalName>
</build>
</project>
\ No newline at end of file
package org.codeling.lang.uml.sif;
import java.util.Arrays;
import java.util.List;
import org.codeling.lang.base.amt.henshintgg.HenshinTGGBasedLanguageDefinition;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.UMLFactory;
import org.osgi.framework.FrameworkUtil;
import de.mkonersmann.il.profiles.Profiles;
public class UMLLanguageDefinition extends HenshinTGGBasedLanguageDefinition {
static final URI henshinTGGFileURI = URI.createPlatformPluginURI(
"/" + FrameworkUtil.getBundle(UMLLanguageDefinition.class).getSymbolicName() + "/IAL2UML.henshin", true);
public UMLLanguageDefinition() {
super(henshinTGGFileURI);
}
/**
* Creates a comment in the UML model to save the element's id in Codeling
*/
@Override
public void setID(EObject object, String id) {
Comment comment = UMLFactory.eINSTANCE.createComment();
comment.setBody("Codeling-ID: " + id);
((Element) object).getOwnedComments().add(comment);
}
/**
* Retrieves the id from a comment in the UML model as it was stored by setID.
*/
@Override
public String getID(EObject object) {
for (Comment c : ((Element) object).getOwnedComments())
if (c.getBody().matches("Codeling-ID: .+"))
return c.getBody().substring("Codeling-ID: ".length());
return null;
}
@Override
public List<String> getSelectedModules() {
return Arrays.asList(Profiles.COMPONENTS_HIERARCHY_SCOPED.getNsURI(), Profiles.CONNECTORS.getNsURI(),
Profiles.CONNECTORS_PROCEDURE_CALLS_SYNCHRONOUS_1TO1.getNsURI(), Profiles.INTERFACES_SCOPED.getNsURI(),
Profiles.INTERFACES_TYPE_OPERATIONS.getNsURI());
}
}