Search in sources :

Example 1 with BindTable

use of com.abubusoft.kripton.android.annotation.BindTable in project kripton by xcesco.

the class BindDataSourceSubProcessor method analyzeSecondRound.

public boolean analyzeSecondRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    parseBindType(roundEnv);
    // Put all @BindTable elements in beanElements
    for (Element item : roundEnv.getElementsAnnotatedWith(BindTable.class)) {
        if (item.getKind() != ElementKind.CLASS) {
            String msg = String.format("%s %s, only class can be annotated with @%s annotation", item.getKind(), item, BindTable.class.getSimpleName());
            throw (new InvalidKindForAnnotationException(msg));
        }
        globalBeanElements.put(item.toString(), (TypeElement) item);
    }
    Set<? extends Element> generatedDaos = roundEnv.getElementsAnnotatedWith(BindGeneratedDao.class);
    for (Element item : generatedDaos) {
        String keyToReplace = AnnotationUtility.extractAsClassName(item, BindGeneratedDao.class, AnnotationAttributeType.DAO);
        globalDaoElements.put(keyToReplace, (TypeElement) item);
        globalDaoGenerated.add(keyToReplace);
    }
    return false;
}
Also used : TypeElement(javax.lang.model.element.TypeElement) Element(javax.lang.model.element.Element) GeneratedTypeElement(com.abubusoft.kripton.processor.element.GeneratedTypeElement) ExecutableElement(javax.lang.model.element.ExecutableElement) InvalidKindForAnnotationException(com.abubusoft.kripton.processor.exceptions.InvalidKindForAnnotationException) BindTable(com.abubusoft.kripton.android.annotation.BindTable)

Aggregations

BindTable (com.abubusoft.kripton.android.annotation.BindTable)1 GeneratedTypeElement (com.abubusoft.kripton.processor.element.GeneratedTypeElement)1 InvalidKindForAnnotationException (com.abubusoft.kripton.processor.exceptions.InvalidKindForAnnotationException)1 Element (javax.lang.model.element.Element)1 ExecutableElement (javax.lang.model.element.ExecutableElement)1 TypeElement (javax.lang.model.element.TypeElement)1