All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spoon.examples.nton.processing.NtonProcessor Maven / Gradle / Ivy

The newest version!
package spoon.examples.nton.processing;

import spoon.examples.nton.annotation.Nton;
import spoon.examples.nton.template.NtonCodeTemplate;
import spoon.processing.AbstractAnnotationProcessor;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.declaration.CtConstructor;
import spoon.template.Substitution;

public class NtonProcessor extends
		AbstractAnnotationProcessor> {

	public void process(Nton nton, CtClass cl) {
		NtonCodeTemplate template = new NtonCodeTemplate(cl.getReference(),
				nton.n());
		Substitution.insertAll(cl, template);
		for (CtConstructor c : cl.getConstructors()) {
			c.getBody().insertEnd(
					Substitution.substituteMethodBody(cl, template,
							"initializer"));
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy