use of org.androidannotations.rclass.IRClass in project androidannotations by androidannotations.
the class AndroidAnnotationProcessor method findRClasses.
private IRClass findRClasses(AndroidManifest androidManifest) throws RClassNotFoundException {
try {
timeStats.start("Find R Classes");
IRClass rClass = new ProjectRClassFinder(androidAnnotationsEnv).find(androidManifest);
IRClass androidRClass = new AndroidRClassFinder(processingEnv).find();
return new CompoundRClass(rClass, androidRClass);
} finally {
timeStats.stop("Find R Classes");
}
}
use of org.androidannotations.rclass.IRClass 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);
}
use of org.androidannotations.rclass.IRClass in project androidannotations by androidannotations.
the class AndroidRClassFinder method find.
public IRClass find() throws RClassNotFoundException {
Elements elementUtils = processingEnv.getElementUtils();
TypeElement androidRType = elementUtils.getTypeElement("android.R");
if (androidRType == null) {
LOGGER.error("The android.R class cannot be found");
throw new RClassNotFoundException("The android.R class cannot be found");
}
LOGGER.info("Found Android class: {}", androidRType.toString());
return new RClass(androidRType);
}
use of org.androidannotations.rclass.IRClass in project androidannotations by androidannotations.
the class ProjectRClassFinder method find.
public IRClass find(AndroidManifest manifest) throws RClassNotFoundException {
Elements elementUtils = environment.getProcessingEnvironment().getElementUtils();
String rClass = getRClassPackageName(manifest) + ".R";
TypeElement rType = elementUtils.getTypeElement(rClass);
if (rType == null) {
LOGGER.error("The generated {} class cannot be found", rClass);
throw new RClassNotFoundException("The generated " + rClass + " class cannot be found");
}
LOGGER.info("Found project R class: {}", rType.toString());
return new RClass(rType);
}
Aggregations