package fr.polytech.devops.g1.stataspoon.processors.operators.binary;

import spoon.processing.AbstractProcessor;
import spoon.reflect.code.BinaryOperatorKind;
import spoon.reflect.code.CtBinaryOperator;

/**
 * Processor Model.
 *
 * @author Antoine Rollin
 */
public abstract class ProcessorModel extends AbstractProcessor<CtBinaryOperator> {

    protected BinaryOperatorKind replaceThis;
    protected BinaryOperatorKind byThis;

    protected ProcessorModel(BinaryOperatorKind replaceThis, BinaryOperatorKind byThis){
        this.replaceThis = replaceThis;
        this.byThis = byThis;
    }

    @Override
    public void process(CtBinaryOperator operator) {
        // Find
        if (!operator.getKind().equals(replaceThis)) return;

        // Replace
        operator.setKind(byThis);
    }
}
@@ -64,16 +64,169 @@
 inary;%0A%0A
+import fr.polytech.devops.g1.stataspoon.processors.selectors.ISelector;%0Aimport fr.polytech.devops.g1.stataspoon.processors.selectors.SelectorController;%0A
 import s
@@ -349,16 +349,58 @@
 perator;
+%0Aimport spoon.reflect.declaration.CtClass;
 %0A%0A/**%0A *
@@ -621,16 +621,49 @@
 byThis;%0A
+    private ISelector selector;%0A%0A
 %0A    pro
@@ -822,78 +822,263 @@
     
-%7D%0A%0A    @Override%0A    public void process(CtBinaryOperator operator) %7B%0A
+    this.selector = SelectorController.getInstance().getSelector();%0A%0A    %7D%0A%0A    @Override%0A    public void process(CtBinaryOperator op) %7B%0A        CtClass parent = op.getParent(CtClass.class);%0A        if(selector.isSelected(parent.getQualifiedName()))%7B%0A    
     
@@ -1101,21 +1101,19 @@
     
+    
 if (!op
-erator
 .get
@@ -1157,16 +1157,20 @@
         
+    
 // Repla
@@ -1180,24 +1180,22 @@
         
-operator
+    op
 .setKind
@@ -1200,19 +1200,29 @@
 nd(byThis);%0A
+        %7D%0A
     %7D%0A%7D

Add the selector into process()