private boolean hasRegisterMapper(Class<?> mapperInterface){
        //如果一个都没匹配上，很可能是还没有注册 mappers，此时通过 @RegisterMapper 注解进行判断
        Class<?>[] interfaces = mapperInterface.getInterfaces();
        boolean hasRegisterMapper = false;
        if (interfaces != null && interfaces.length > 0) {
            for (Class<?> anInterface : interfaces) {
                //自动注册标记了 @RegisterMapper 的接口
                if(anInterface.isAnnotationPresent(RegisterMapper.class)){
                    hasRegisterMapper = true;
                    //如果已经注册过，就避免在反复调用下面会迭代的方法
                    if (!registerMapper.containsKey(anInterface)) {
                        registerMapper(anInterface);
                    }
                }
                //如果父接口的父接口存在注解，也可以注册
                else if(hasRegisterMapper(anInterface)){
                    hasRegisterMapper = true;
                }
            }
        }
        return hasRegisterMapper;
    }
private boolean hasRegisterMapper ( Class < ? > mapperInterface ) { Class < ? > [ ] interfaces = mapperInterface . getInterfaces ( ) ; boolean hasRegisterMapper = false ; if ( interfaces != null && interfaces . length > 0 ) { for ( Class < ? > anInterface : interfaces ) { if ( anInterface . isAnnotationPresent ( RegisterMapper . class ) ) { hasRegisterMapper = true ; if ( ! registerMapper . containsKey ( anInterface ) ) { registerMapper ( anInterface ) ; } } else if ( hasRegisterMapper ( anInterface ) ) { hasRegisterMapper = true ; } } } return hasRegisterMapper ; }
增加通过 @RegisterMapper 注解自动注册的功能

@param mapperInterface
@return