01: package spoon.jdiet;
02:
03: import spoon.processing.AbstractProcessor;
04: import spoon.processing.ProcessingManager;
05: import spoon.reflect.declaration.CtClass;
06:
07: /**
08: * This processor translates a Java source code into a J2ME compliant version.
09: *
10: * This processor does not perform any concrete translation. It just registers
11: * the other processor which will be perform the real job. This processor is
12: * just the entry point of the translation process.
13: *
14: * @author Lionel Seinturier <Lionel.Seinturier@lifl.fr>
15: */
16: public class JDietProcessor extends AbstractProcessor<CtClass> {
17:
18: public boolean isToBeProcessed(CtClass ct) {
19: return first;
20: }
21:
22: private boolean first = true;
23:
24: public void process(CtClass ct) {
25: ProcessingManager pm = getManager();
26: pm.addProcessor(new ClassProcessor());
27: pm.addProcessor(new ExpressionProcessor());
28: pm.addProcessor(new InvocationProcessor());
29: pm.addProcessor(new MethodProcessor());
30: pm.addProcessor(new NewClassProcessor());
31: pm.addProcessor(new VariableProcessor());
32: first = false;
33: }
34:
35: }
|