public boolean analyzeRound ( Set < ? extends TypeElement > annotations , RoundEnvironment roundEnv ) { parseBindType ( roundEnv ) ; // Put all @BindSqlType elements in beanElements for ( Element item : roundEnv . getElementsAnnotatedWith ( BindSqlType . class ) ) { if ( item . getKind ( ) != ElementKind . CLASS ) { String msg = String . format ( "%s %s, only class can be annotated with @%s annotation" , item . getKind ( ) , item , BindSqlType . class . getSimpleName ( ) ) ; throw ( new InvalidKindForAnnotationException ( msg ) ) ; } globalBeanElements . put ( item . toString ( ) , ( TypeElement ) item ) ; } // we have generated bean too. // Put all @BindDao elements in daoElements for ( Element item : roundEnv . getElementsAnnotatedWith ( BindDao . class ) ) { // dao generated will used to replace original dao, so it can not be // inserted like others. if ( item . getAnnotation ( BindGeneratedDao . class ) != null ) continue ; if ( item . getKind ( ) != ElementKind . INTERFACE ) { String msg = String . format ( "%s %s can not be annotated with @%s annotation, because it is not an interface" , item . getKind ( ) , item , BindDao . class . getSimpleName ( ) ) ; throw ( new InvalidKindForAnnotationException ( msg ) ) ; } globalDaoElements . put ( item . toString ( ) , ( TypeElement ) item ) ; } for ( Element item : roundEnv . getElementsAnnotatedWith ( BindDaoMany2Many . class ) ) { if ( item . getKind ( ) != ElementKind . INTERFACE ) { String msg = String . format ( "%s %s can not be annotated with @%s annotation, because it is not an interface" , item . getKind ( ) , item , BindDaoMany2Many . class . getSimpleName ( ) ) ; throw ( new InvalidKindForAnnotationException ( msg ) ) ; } globalDaoElements . put ( item . toString ( ) , ( TypeElement ) item ) ; } // Get all database schema definitions for ( Element item : roundEnv . getElementsAnnotatedWith ( BindDataSource . class ) ) { dataSets . add ( ( TypeElement ) item ) ; } // exit without error if ( dataSets . size ( ) == 0 ) return false ; // No bind type is present if ( globalDaoElements . size ( ) == 0 ) { throw ( new NoDaoElementFound ( ) ) ; } return false ; }
Analyze round .