tk.labyrinth.jaap.testing.TestCallbackProcessor Maven / Gradle / Ivy
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 extends TypeElement> 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