Commit 3d77d105 authored by Marco Konersmann's avatar Marco Konersmann

Adds CompilerTransformation

parent c731016c
......@@ -4,6 +4,7 @@ import java.util.List;
import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformation;
import org.codeling.lang.jmeter.metamodel.jmeter.Compiler;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterFactory;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.transformation.processcomponent_feature.ProtoTransformation;
import org.codeling.mechanisms.transformations.ClassMechanismTransformation;
......@@ -12,10 +13,10 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IType;
public class CompilerTransformation extends ClassMechanismTransformation<Compiler, IType> {
public CompilerTransformation(AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
public CompilerTransformation(
AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation, JmeterPackage.eINSTANCE.getCompiler());
}
......@@ -24,39 +25,45 @@ public class CompilerTransformation extends ClassMechanismTransformation<Compile
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
result.add(new ProtoTransformation<Compiler>(this));
}
@Override
protected void doCreateChildTransformationsToCode(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
}
@Override
protected void doCreateChildTransformationsToModel(List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
protected void doCreateChildTransformationsToModel(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
}
@Override
public void createCodeFragments() throws CodelingException {
// TODO Auto-generated method stub
}
@Override
public void updateCodeFragments() throws CodelingException {
// TODO Auto-generated method stub
}
@Override
public void deleteCodeFragments() throws CodelingException {
// TODO Auto-generated method stub
}
@Override
public Compiler transformToModel() throws CodelingException {
// TODO Auto-generated method stub
return null;
modelElement = (Compiler) JmeterFactory.eINSTANCE.create(JmeterPackage.eINSTANCE.getCompiler());
modelElement.setName(codeElement.getElementName());
return modelElement;
}
public boolean isCompiler(IType type) {
return type.getElementName().endsWith("Compiler");
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformatio
import org.codeling.lang.jmeter.metamodel.jmeter.JMeterThread;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.metamodel.jmeter.ProcessComponent;
import org.codeling.lang.jmeter.transformation.CompilerTransformation;
import org.codeling.lang.jmeter.transformation.EventListenerTransformation;
import org.codeling.lang.jmeter.transformation.PostProcessorTransformation;
import org.codeling.lang.jmeter.transformation.PreProcessorTransformation;
......@@ -56,6 +57,7 @@ public class ProcesscomponentTransformation
PreProcessorTransformation tPre = new PreProcessorTransformation(this);
EventListenerTransformation tEvent = new EventListenerTransformation(this);
ThreadListenerTransformation tThread = new ThreadListenerTransformation(this);
CompilerTransformation tCompiler = new CompilerTransformation(this);
if (tPost.hasExpectedInterface(type))
......@@ -66,6 +68,8 @@ public class ProcesscomponentTransformation
t = tEvent;
else if (tThread.hasExpectedInterface(type))
t = tThread;
else if (tCompiler.isCompiler(type))
t = tCompiler;
else
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment