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

tk.labyrinth.jaap.testing.TestCallbackProcessor Maven / Gradle / Ivy

There is a newer version: 0.4.2
Show newest version
package tk.labyrinth.jaap.testing;

import lombok.AllArgsConstructor;
import tk.labyrinth.jaap.core.AdvancedAbstractProcessor;

import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.element.TypeElement;
import java.util.Set;
import java.util.function.BiConsumer;

@AllArgsConstructor
@SupportedAnnotationTypes("*")
public class TestCallbackProcessor extends AdvancedAbstractProcessor {

	private BiConsumer callback;

	@Override
	protected boolean doProcess(Set annotations, RoundEnvironment roundEnv) {
		// TODO: Avoiding repetition, as there are at least 2 processing rounds.
		//  We may invent smth. more sensible.
		if (roundEnv.processingOver()) {
			callback.accept(processingEnv, roundEnv);
		}
		return false;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy