use of com.github.mvp4g.mvp4g2.processor.scanner.validation.HistoryAnnotationValidator in project mvp4g2 by mvp4g.
the class HistoryAnnotationScanner method scan.
public HistoryMetaModel scan(RoundEnvironment roundEnvironment) throws ProcessorException {
// First we try to read an already created resource ...
HistoryMetaModel model = this.restore();
// Check if we have an element annotated with @Application
if (!roundEnvironment.getElementsAnnotatedWith(History.class).isEmpty()) {
// check annotation ...
HistoryAnnotationValidator validator = HistoryAnnotationValidator.builder().roundEnvironment(roundEnvironment).processingEnvironment(this.processingEnvironment).build();
// iterate over all history converters
for (Element element : roundEnvironment.getElementsAnnotatedWith(History.class)) {
// validate
validator.validate(element);
// process ...
TypeElement typeElement = (TypeElement) element;
History historyAnnotation = typeElement.getAnnotation(History.class);
validator.validate(element);
model.add(typeElement.getQualifiedName().toString(), historyAnnotation.type().toString());
}
// let's store the updated model
this.processorUtils.store(model, this.createRelativeFileName());
}
return model;
}
Aggregations