br.com.jarch.apt.processor.TaskBeanProcessor Maven / Gradle / Ivy
package br.com.jarch.apt.processor;
import br.com.jarch.annotation.JArchConfiguration;
import br.com.jarch.annotation.JArchTaskBean;
import br.com.jarch.util.ProcessorUtils;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
import java.util.Set;
@SupportedAnnotationTypes("br.com.jarch.annotation.JArchTaskBean")
public class TaskBeanProcessor extends AbstractProcessor {
@Override
public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
ProcessorUtils.processingEnvironment = processingEnv;
ProcessorUtils.messageMandatoryWarning("Processando: " + getClass().getSimpleName());
try {
roundEnv
.getElementsAnnotatedWith(JArchTaskBean.class)
.stream()
.filter(element -> element.getEnclosingElement().getAnnotation(JArchConfiguration.class) == null
|| !element.getEnclosingElement().getAnnotation(JArchConfiguration.class).ignorePatternsObjetcsDataBase())
.forEach(element -> {
ProcessorUtils.messageAnalyzing(getClass(), element);
// SearchCodeGenerate.generate(processingEnv, element);
}
);
} catch (Exception ex) {
ProcessorUtils.messageError("JARCH ERROR: Erro no APT " + getClass().getSimpleName() + " Mensagem: " + ex.getMessage());
}
return false;
}
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy