use of com.github.mvp4g.mvp4g2.processor.scanner.validation.HandlerAnnotationValidator in project mvp4g2 by mvp4g.
the class HandlerAnnotationScanner method scan.
public HandlerMetaModel scan(RoundEnvironment roundEnvironment) throws ProcessorException {
// Validator
HandlerAnnotationValidator validator = HandlerAnnotationValidator.builder().roundEnvironment(roundEnvironment).processingEnvironment(processingEnvironment).build();
// read all already created model
HandlerMetaModel model = this.restore();
for (Element element : roundEnvironment.getElementsAnnotatedWith(Handler.class)) {
TypeElement typeElement = (TypeElement) element;
// validate the element. In case of error throw exception!
validator.validate(typeElement);
// update model
model.add(((TypeElement) element).getQualifiedName().toString(), this.processorUtils.createHandledEventArray(typeElement));
}
// let's store the updated model
this.processorUtils.store(model, this.createRelativeFileName());
return model;
}
Aggregations