Commit 31937e3c authored by Marco Konersmann's avatar Marco Konersmann

Refactoring

* contents of mechanisms.tests moved to language.base.java
* createRootTransformationInstance now has zero parameters
  It is configured automatically in JavaBasdImplementationLanguageDefinition
* priorRegistry and language definition now owned by AbstractModelCodeTransformation
parent 2dde01bf
......@@ -73,7 +73,6 @@
<plugin id="javax.xml"/>
<plugin id="lpg.runtime.java"/>
<plugin id="mechanisms"/>
<plugin id="mechanisms.test" fragment="true"/>
<plugin id="org.antlr.runtime"/>
<plugin id="org.apache.ant"/>
<plugin id="org.apache.batik.bridge"/>
......
......@@ -22,9 +22,8 @@ public abstract class ImplementationLanguageDefinition extends LanguageDefinitio
public abstract TransformationResult transformTMToIM(List<EObject> ilRoots, IDRegistry idRegistry)
throws CodelingException;
public abstract void transformIMToCode(List<EObject> newModelRoots, List<EObject> oldModelRoots,
IDRegistry idRegistry_newModel, IDRegistry idregistry_oldModel, List<IJavaProject> projects)
throws CodelingException;
public abstract void transformIMToCode(List<EObject> newModelRoots, List<EObject> oldModelRoots, IDRegistry idRegistry_newModel,
IDRegistry idregistry_oldModel, List<IJavaProject> projects) throws CodelingException;
public abstract void transformTMToCode(List<EObject> ilRoots, List<EObject> cmRoots, IDRegistry idRegistry,
List<IJavaProject> projects) throws CodelingException;
......
......@@ -28,8 +28,8 @@ public class ImplementationModelToCodeTask extends AbstractTask {
final ImplementationLanguageDefinition implementationLanguage;
private boolean isImplementationMigration;
public ImplementationModelToCodeTask(ImplementationLanguageDefinition implementationLanguage, List<IJavaProject> projects,
boolean isImplementationMigration) {
public ImplementationModelToCodeTask(ImplementationLanguageDefinition implementationLanguage,
List<IJavaProject> projects, boolean isImplementationMigration) {
super(TASK_NAME);
this.projects = projects;
this.implementationLanguage = implementationLanguage;
......@@ -44,8 +44,10 @@ public class ImplementationModelToCodeTask extends AbstractTask {
final IDRegistry idregistry_oldModel = IDRegistry.load(ProgramCodeToImplementationModelTask.ID_FILEPATH);
progressMonitor.worked(5);
// Load old model
final List<EObject> oldModelRoots = Models.loadFrom(ProgramCodeToImplementationModelTask.MODEL_FILEPATH);
// Load old model (must be null during implementation migration)
List<EObject> oldModelRoots = null;
if (!isImplementationMigration)
oldModelRoots = Models.loadFrom(ProgramCodeToImplementationModelTask.MODEL_FILEPATH);
progressMonitor.worked(5);
// Load new IDs
......@@ -66,7 +68,7 @@ public class ImplementationModelToCodeTask extends AbstractTask {
removeCodeAndCMElementEntries(idregistry_oldModel);
removeCodeElementEntries(idregistry_newModel);
}
implementationLanguage.transformIMToCode(newModelRoots, null, idregistry_newModel,
implementationLanguage.transformIMToCode(newModelRoots, oldModelRoots, idregistry_newModel,
idregistry_oldModel, projects);
progressMonitor.worked(80);
......
......@@ -49,15 +49,8 @@ public class CoCoMELanguageDefinition extends JavaBasedImplementationLanguageDef
}
@Override
public AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance(
List<IJavaProject> projects, IDRegistry idregistry, List<EObject> priorModelElements) {
ArchitectureTransformation t = new ArchitectureTransformation(null);
t.setCodeRoot(projects);
t.setIDRegistry(idregistry);
if (priorModelElements != null && !priorModelElements.isEmpty())
t.setPriorModelElement(priorModelElements.get(0));
t.setLanguageDefinition(this);
return t;
public AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance() {
return new ArchitectureTransformation();
}
@Override
......
......@@ -13,28 +13,29 @@ import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransfor
public class ArchitectureTransformation extends NinjaSingletonTransformation<Architecture> {
public ArchitectureTransformation(AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation, CoCoMEPackage.eINSTANCE.getArchitecture());
public ArchitectureTransformation() {
super(null, CoCoMEPackage.eINSTANCE.getArchitecture());
}
@Override
public void doCreateCrossReferencesTransformations(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// Child transformations for cross references
// Child transformations for cross references
}
@Override
protected void doCreateChildTransformationsToCode(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// Child transformations for containment references
result.add(new ComponentsTransformation(this));
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// Child transformations for containment references
result.add(new ComponentsTransformation(this));
}
@Override
protected void doCreateChildTransformationsToModel(List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// Child transformations for containment references
result.add(new ComponentsTransformation(this));
protected void doCreateChildTransformationsToModel(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// Child transformations for containment references
result.add(new ComponentsTransformation(this));
}
}
\ No newline at end of file
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Codeling Java Integration Utilities Test
Bundle-Name: %pluginName
Bundle-SymbolicName: org.codeling.lang.base.java.tests;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: Marco Konersmann <marco.konersmann@paluno.uni-due.de>
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Fragment-Host: org.codeling.lang.base.java
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: cm.metamodel.cmDummy,
......@@ -16,9 +17,13 @@ Export-Package: cm.metamodel.cmDummy,
il.metamodel.ilDummy.util,
jobDependencyTestMetaModel,
jobDependencyTestMetaModel.impl,
jobDependencyTestMetaModel.util
jobDependencyTestMetaModel.util,
testPackage,
testPackage.impl,
testPackage.util
Require-Bundle: org.junit;bundle-version="4.0.0",
org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.jdt.launching
org.eclipse.jdt.launching,
org.eclipse.xtend.lib
Bundle-ActivationPolicy: lazy
source.. = src/test/java/,src/test/resources
output.. = target/classes/
#
bin.includes = .,\
model/,\
META-INF/,\
src/test/resources/
\ No newline at end of file
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/test/generated/
output.. = bin/
......@@ -11,7 +11,7 @@
<package
uri="http://example.org/test/1.0"
class="testPackage.TestPackagePackage"
genModel="src/main/resources/TestLanguage.genmodel"/>
genModel="src/test/resources/TestLanguage.genmodel"/>
</extension>
</plugin>
......@@ -3,7 +3,9 @@
package testPackage.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
......
......@@ -5,12 +5,12 @@ package testPackage.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import testPackage.Named;
import testPackage.TestPackageFactory;
import testPackage.TestPackagePackage;
import testPackage.*;
/**
* <!-- begin-user-doc -->
......
......@@ -5,6 +5,7 @@ package testPackage.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import testPackage.Named;
......
......@@ -4,11 +4,12 @@ package testPackage.util;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
import testPackage.Named;
import testPackage.TestPackagePackage;
import testPackage.*;
/**
* <!-- begin-user-doc -->
......
......@@ -4,10 +4,10 @@ package testPackage.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import testPackage.Named;
import testPackage.TestPackagePackage;
import testPackage.*;
/**
* <!-- begin-user-doc -->
......
......@@ -4,6 +4,7 @@ import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransfor
import java.util.Arrays
import java.util.List
import java.util.concurrent.ExecutionException
import org.codeling.mechanisms.transformations.classes.MarkerInterfaceTransformation
import org.codeling.test.jdt.JDTUtils
import org.eclipse.core.runtime.CoreException
import org.eclipse.emf.ecore.EClass
......
......@@ -4,6 +4,7 @@ import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransfor
import java.util.Arrays
import java.util.List
import java.util.concurrent.ExecutionException
import org.codeling.mechanisms.transformations.classes.TypeAnnotationTransformation
import org.codeling.test.jdt.JDTUtils
import org.eclipse.core.runtime.CoreException
import org.eclipse.emf.ecore.EClass
......
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/mechanisms.test/src/main/generated" editDirectory="/mechanisms.test.edit/src/main/generated"
editorDirectory="/mechanisms.test.editor/src/main/generated" modelPluginID="mechanisms.test"
modelName="TestLanguage" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
testsDirectory="/mechanisms.test.tests/src/main/generated" importerID="org.eclipse.emf.importer.ecore"
complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true">
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.codeling.lang.base.java.tests/src/test/generated"
editDirectory="/org.codeling.lang.base.java.tests.edit/src/main/generated" editorDirectory="/org.codeling.lang.base.java.tests.editor/src/main/generated"
modelPluginID="org.codeling.lang.base.java.tests" modelName="TestLanguage" modelPluginClass=""
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" testsDirectory="/org.codeling.lang.base.java.tests.tests/src/main/generated"
importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
operationReflection="true" importOrganizing="true">
<foreignModel>TestLanguage.ecore</foreignModel>
<genPackages prefix="TestPackage" disposableProviderFactory="true" ecorePackage="TestLanguage.ecore#/">
<genClasses ecoreClass="TestLanguage.ecore#//Named">
......
......@@ -51,24 +51,15 @@ public abstract class JavaBasedImplementationLanguageDefinition extends Implemen
* Returns an instance of the root transformation to execute on the given
* projects.
*/
public abstract AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance(
List<IJavaProject> projects, IDRegistry idregistry, List<EObject> priorModelElements);
public abstract AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance();
@Override
public void transformIMToCode(List<EObject> newModelRoots, List<EObject> oldModelRoots,
IDRegistry idRegistry_newModel, IDRegistry idregistry_oldModel, List<IJavaProject> projects)
throws CodelingException {
final AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> rootTransformation = createRootTransformationInstance(
projects, idRegistry_newModel, oldModelRoots);
findTranslatedElements = new FindTranslatedElements();
rootTransformation.setWhereToFindTranslatedElements(findTranslatedElements);
rootTransformation.setModelElement(newModelRoots.get(0));
rootTransformation.setPriorIDRegistry(idregistry_oldModel);
if (oldModelRoots != null)
rootTransformation.setPriorModelElement(oldModelRoots.get(0));
final AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> rootTransformation = createRootTransformationInstance();
configureRootTransformation(rootTransformation, projects, newModelRoots, idRegistry_newModel, oldModelRoots,
idregistry_oldModel);
monitor.worked(10);
final ModelToJavaTransformation executor = new ModelToJavaTransformation(projects, rootTransformation,
......@@ -77,6 +68,31 @@ public abstract class JavaBasedImplementationLanguageDefinition extends Implemen
monitor.worked(70);
}
private void configureRootTransformation(
final AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> rootTransformation,
List<IJavaProject> projects, List<EObject> newModelRoots, IDRegistry idRegistry_newModel,
List<EObject> oldModelRoots, IDRegistry idregistry_oldModel) {
// All attributes may already be set by createRootTransformationInstance
if (rootTransformation.getLanguageDefinition() == null)
rootTransformation.setLanguageDefinition(this);
if (rootTransformation.getCodeRoot() == null)
rootTransformation.setCodeRoot(projects);
if (rootTransformation.getIdRegistry() == null)
rootTransformation.setIDRegistry(idRegistry_newModel);
if (rootTransformation.getPriorIDRegistry() == null)
rootTransformation.setPriorIDRegistry(idregistry_oldModel);
if (rootTransformation.getModelElement() == null && newModelRoots != null && !newModelRoots.isEmpty())
rootTransformation.setModelElement(newModelRoots.get(0));
if (rootTransformation.getPriorModelElement() == null && oldModelRoots != null && !oldModelRoots.isEmpty())
rootTransformation.setPriorModelElement(oldModelRoots.get(0));
if (rootTransformation.getWhereToFindTranslatedElements() == null) {
findTranslatedElements = new FindTranslatedElements();
rootTransformation.setWhereToFindTranslatedElements(findTranslatedElements);
} else {
findTranslatedElements = rootTransformation.getWhereToFindTranslatedElements();
}
}
@Override
public void transformTMToCode(List<EObject> ilRoots, List<EObject> cmRoots, IDRegistry idRegistry,
List<IJavaProject> projects) throws CodelingException {
......@@ -178,10 +194,8 @@ public abstract class JavaBasedImplementationLanguageDefinition extends Implemen
throws CodelingException {
// Initialize the root transformation
final AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> rootTransformation = createRootTransformationInstance(
projects, idregistry, null);
findTranslatedElements = new FindTranslatedElements();
rootTransformation.setWhereToFindTranslatedElements(findTranslatedElements);
final AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> rootTransformation = createRootTransformationInstance();
configureRootTransformation(rootTransformation, projects, null, idregistry, null, null);
monitor.worked(10);
final JavaToModelTransformation executor = new JavaToModelTransformation(projects, idregistry,
......
......@@ -5,6 +5,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.RecursiveAction;
import org.codeling.languageregistry.LanguageDefinition;
import org.codeling.mechanisms.transformations.IntegrationMechanismTransformation;
import org.codeling.utils.CodelingException;
import org.codeling.utils.CodelingLogger;
import org.codeling.utils.IDRegistry;
......@@ -85,8 +87,16 @@ public abstract class AbstractModelCodeTransformation<ELEMENTECLASS extends EObj
*/
protected IDRegistry idRegistry;
/**
* The parent transformation in a tree structure
*/
protected IModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation;
/**
* The language definition, which declares this transformation
*/
private LanguageDefinition languageDefinition;
protected AbstractModelCodeTransformation(
AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
this.parentTransformation = parentTransformation;
......@@ -97,6 +107,7 @@ public abstract class AbstractModelCodeTransformation<ELEMENTECLASS extends EObj
this.priorIDRegistry = parentTransformation.priorIDRegistry;
this.findTranslatedElements = parentTransformation.findTranslatedElements;
this.codeRoot = parentTransformation.codeRoot;
this.languageDefinition = parentTransformation.getLanguageDefinition();
parentTransformation.addChildIssue(this);
}
}
......@@ -609,6 +620,30 @@ public abstract class AbstractModelCodeTransformation<ELEMENTECLASS extends EObj
return idRegistry;
}
/*
* (non-Javadoc)
*
* @see
* de.mkonersmann.advert.java.embed.transformation.IModelCodeTransformation#
* getPriorIdRegistry()
*/
@Override
public IDRegistry getPriorIDRegistry() {
return priorIDRegistry;
}
public String getLanguageName() {
return getLanguageDefinition().getSymbolicName();
}
public LanguageDefinition getLanguageDefinition() {
return languageDefinition;
}
public void setLanguageDefinition(LanguageDefinition languageDefinition) {
this.languageDefinition = languageDefinition;
}
// Utility Methods
protected IPackageFragment createDefaultPackage() throws CoreException {
final IJavaProject project = codeRoot.get(0);
......
......@@ -47,6 +47,8 @@ public interface IModelCodeTransformation<ELEMENTECLASS extends EObject, JAVAELE
void setPriorIDRegistry(IDRegistry priorIDRegistry);
IDRegistry getPriorIDRegistry();
// Getters and Setters
List<IJavaProject> getCodeRoot();
......
......@@ -3,32 +3,14 @@ package org.codeling.mechanisms.transformations;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
import de.mkonersmann.advert.java.embed.JavaBasedImplementationLanguageDefinition;
import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransformation;
public abstract class IntegrationMechanismTransformation<ELEMENTECLASS extends EObject, JAVAELEMENTCLASS extends IJavaElement>
extends AbstractModelCodeTransformation<ELEMENTECLASS, JAVAELEMENTCLASS> {
private JavaBasedImplementationLanguageDefinition languageDefinition;
public IntegrationMechanismTransformation(
AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation);
if (parentTransformation instanceof IntegrationMechanismTransformation)
setLanguageDefinition(
((IntegrationMechanismTransformation<?, ?>) parentTransformation).getLanguageDefinition());
}
public String getLanguageName() {
return getLanguageDefinition().getSymbolicName();
}
public JavaBasedImplementationLanguageDefinition getLanguageDefinition() {
return languageDefinition;
}
public void setLanguageDefinition(JavaBasedImplementationLanguageDefinition languageDefinition) {
this.languageDefinition = languageDefinition;
}
}
......@@ -33,7 +33,7 @@ abstract class NamespaceHierarchyReferenceTransformation<OWNERECLASS extends EOb
// Find all types or interfaces that represent a model object of the targeted type.
codeElement.compilationUnits.forEach [ cu |
cu.types.forEach [ t |
val transformations = languageDefinition.whereToFindTranslatedElements.getTransformationsFor(t);
val transformations = whereToFindTranslatedElements.getTransformationsFor(t);
if (!transformations.nullOrEmpty && transformations.exists [ transformation |
transformation.canHandle(eReference.EReferenceType)
]) {
......
......@@ -58,7 +58,7 @@ abstract class ProjectReferenceTransformation<OWNERECLASS extends EObject, TARGE
r.children.forEach [ p |
(p as IPackageFragment).compilationUnits.forEach [ cu |
cu.types.forEach [ t |
val transformations = languageDefinition.whereToFindTranslatedElements.getTransformationsFor(t);
val transformations = whereToFindTranslatedElements.getTransformationsFor(t);
if (!transformations.nullOrEmpty && transformations.exists [ transformation |
transformation.canHandle(eReference.EReferenceType)
]) {
......
......@@ -19,7 +19,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.osgi.framework.FrameworkUtil;
import de.mkonersmann.advert.java.embed.JavaBasedImplementationLanguageDefinition;
......@@ -66,15 +65,8 @@ public class JEE7LanguageDefinition extends JavaBasedImplementationLanguageDefin
}
@Override
public AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance(
List<IJavaProject> projects, IDRegistry idregistry, List<EObject> priorModelElements) {
ArchitectureTransformation t = new ArchitectureTransformation(null);
t.setCodeRoot(projects);
t.setIDRegistry(idregistry);
if (priorModelElements != null && !priorModelElements.isEmpty())
t.setPriorModelElement(priorModelElements.get(0));
t.setLanguageDefinition(this);
return t;
public AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance() {
return new ArchitectureTransformation();
}
@Override
......
......@@ -16,9 +16,8 @@ import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransfor
public class ArchitectureTransformation extends NinjaSingletonTransformation<Architecture> {
public ArchitectureTransformation(
AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation, JEE7Package.eINSTANCE.getArchitecture());
public ArchitectureTransformation() {
super(null, JEE7Package.eINSTANCE.getArchitecture());
}
@Override
......
package org.codeling.lang.ejbWithStatemachine.transformation
import de.mkonersmann.advert.java.embed.JDTUtils
import de.mkonersmann.advert.utils.IDRegistry
import java.util.Arrays
import org.codeling.lang.ejbWithStatemachine.mm.ejbWithSM.StateMachine
import org.codeling.lang.ejbWithStatemachine.mm.ejbWithSM.ejbWithSMFactory
import org.codeling.utils.IDRegistry
import org.eclipse.jdt.core.IJavaProject
import org.eclipse.jdt.core.IPackageFragment
import org.junit.Test
......
package org.codeling.lang.ejbWithStatemachine.transformation
import de.mkonersmann.advert.java.embed.JDTUtils
import de.mkonersmann.advert.utils.IDRegistry
import java.util.Arrays
import org.codeling.lang.ejbWithStatemachine.mm.ejbWithSM.State
import org.codeling.lang.ejbWithStatemachine.mm.ejbWithSM.ejbWithSMFactory
import org.codeling.utils.IDRegistry
import org.eclipse.jdt.core.IJavaProject
import org.eclipse.jdt.core.IPackageFragment
import org.junit.Test
......
package org.codeling.lang.ejbWithStatemachine.transformation
import de.mkonersmann.advert.transformationmanager.ITransformationManager
import java.net.URI
import java.util.List
import org.codeling.transformationmanager.ITransformationManager
import org.eclipse.core.resources.IProject
import org.eclipse.core.resources.IProjectDescription
import org.eclipse.core.resources.IWorkspace
......
......@@ -13,9 +13,8 @@ import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransfor
public class ArchitectureTransformation extends NinjaSingletonTransformation<Architecture> {
public ArchitectureTransformation(
AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation, ejbWithSMPackage.eINSTANCE.getArchitecture());
public ArchitectureTransformation() {
super(null, ejbWithSMPackage.eINSTANCE.getArchitecture());
}
@Override
......
......@@ -20,7 +20,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.osgi.framework.FrameworkUtil;
import de.mkonersmann.advert.java.embed.JavaBasedImplementationLanguageDefinition;
......@@ -61,13 +60,8 @@ public class EjbWithStateMachineLanguage extends JavaBasedImplementationLanguage
}
@Override
public AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance(
List<IJavaProject> projects, IDRegistry idRegistry) {
ArchitectureTransformation t = new ArchitectureTransformation(null);
t.setCodeRoot(projects);
t.setIDRegistry(idRegistry);
t.setLanguageDefinition(this);
return t;
public AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> createRootTransformationInstance() {
return new ArchitectureTransformation();
}
@Override
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/generated/"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="src" path="src/main/resources/"/>
<classpathentry kind="src" path="src/main/xtend-gen/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.codeling.mechanisms.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>