Search in sources :

Example 1 with AnnotationElements

use of org.androidannotations.internal.model.AnnotationElements in project androidannotations by androidannotations.

the class AndroidAnnotationProcessor method processThrowing.

private void processThrowing(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws Exception {
    if (nothingToDo(annotations, roundEnv)) {
        return;
    }
    AnnotationElementsHolder extractedModel = extractAnnotations(annotations, roundEnv);
    AnnotationElementsHolder validatingHolder = extractedModel.validatingHolder();
    androidAnnotationsEnv.setValidatedElements(validatingHolder);
    try {
        AndroidManifest androidManifest = extractAndroidManifest();
        LOGGER.info("AndroidManifest.xml found: {}", androidManifest);
        IRClass rClass = findRClasses(androidManifest);
        androidAnnotationsEnv.setAndroidEnvironment(rClass, androidManifest);
    } catch (Exception e) {
        return;
    }
    AnnotationElements validatedModel = validateAnnotations(extractedModel, validatingHolder);
    ModelProcessor.ProcessResult processResult = processAnnotations(validatedModel);
    generateSources(processResult);
}
Also used : AnnotationElements(org.androidannotations.internal.model.AnnotationElements) AnnotationElementsHolder(org.androidannotations.internal.model.AnnotationElementsHolder) IRClass(org.androidannotations.rclass.IRClass) ModelProcessor(org.androidannotations.internal.process.ModelProcessor) AndroidManifest(org.androidannotations.helper.AndroidManifest) VersionNotFoundException(org.androidannotations.internal.exception.VersionNotFoundException) ValidationException(org.androidannotations.internal.exception.ValidationException) ProcessingException(org.androidannotations.internal.exception.ProcessingException) AndroidManifestNotFoundException(org.androidannotations.internal.exception.AndroidManifestNotFoundException) IOException(java.io.IOException) VersionMismatchException(org.androidannotations.internal.exception.VersionMismatchException) FileNotFoundException(java.io.FileNotFoundException) RClassNotFoundException(org.androidannotations.internal.exception.RClassNotFoundException)

Example 2 with AnnotationElements

use of org.androidannotations.internal.model.AnnotationElements in project androidannotations by androidannotations.

the class AndroidAnnotationProcessor method validateAnnotations.

private AnnotationElements validateAnnotations(AnnotationElements extractedModel, AnnotationElementsHolder validatingHolder) throws ValidationException {
    timeStats.start("Validate Annotations");
    ModelValidator modelValidator = new ModelValidator(androidAnnotationsEnv);
    AnnotationElements validatedAnnotations = modelValidator.validate(extractedModel, validatingHolder);
    timeStats.stop("Validate Annotations");
    return validatedAnnotations;
}
Also used : AnnotationElements(org.androidannotations.internal.model.AnnotationElements) ModelValidator(org.androidannotations.internal.process.ModelValidator)

Aggregations

AnnotationElements (org.androidannotations.internal.model.AnnotationElements)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 AndroidManifest (org.androidannotations.helper.AndroidManifest)1 AndroidManifestNotFoundException (org.androidannotations.internal.exception.AndroidManifestNotFoundException)1 ProcessingException (org.androidannotations.internal.exception.ProcessingException)1 RClassNotFoundException (org.androidannotations.internal.exception.RClassNotFoundException)1 ValidationException (org.androidannotations.internal.exception.ValidationException)1 VersionMismatchException (org.androidannotations.internal.exception.VersionMismatchException)1 VersionNotFoundException (org.androidannotations.internal.exception.VersionNotFoundException)1 AnnotationElementsHolder (org.androidannotations.internal.model.AnnotationElementsHolder)1 ModelProcessor (org.androidannotations.internal.process.ModelProcessor)1 ModelValidator (org.androidannotations.internal.process.ModelValidator)1 IRClass (org.androidannotations.rclass.IRClass)1