use of com.github.mvp4g.mvp4g2.processor.scanner.validation.PresenterAnnotationValidator in project mvp4g2 by mvp4g.
the class PresenterAnnotationScanner method scan.
public PresenterMetaModel scan(RoundEnvironment roundEnvironment) throws ProcessorException {
// Validator
PresenterAnnotationValidator validator = PresenterAnnotationValidator.builder().processingEnvironment(processingEnvironment).build();
// read all already created model
PresenterMetaModel model = this.restore();
// iterate over Presenter
for (Element element : roundEnvironment.getElementsAnnotatedWith(Presenter.class)) {
TypeElement typeElement = (TypeElement) element;
// validate
validator.validate(typeElement, this.getViewClassTypeElement(typeElement.getAnnotation(Presenter.class)), this.getViewInterfaceTypeElement(typeElement.getAnnotation(Presenter.class)));
// update model
model.add(((TypeElement) element).getQualifiedName().toString(), typeElement.getAnnotation(Presenter.class).multiple() ? "true" : "false", this.processorUtils.extendsClassOrInterface(this.processingEnvironment.getTypeUtils(), typeElement.asType(), this.processingEnvironment.getElementUtils().getTypeElement(IsShell.class.getCanonicalName()).asType()) ? "true" : "false", this.getViewClassTypeElement(element.getAnnotation(Presenter.class)).getQualifiedName().toString(), this.getViewInterfaceTypeElement(element.getAnnotation(Presenter.class)).getQualifiedName().toString(), typeElement.getAnnotation(Presenter.class).viewCreator().toString(), this.processorUtils.createHandledEventArray(typeElement));
}
// let's store the updated model
this.processorUtils.store(model, this.createRelativeFileName());
return model;
}
Aggregations