Java 类org.springframework.boot.autoconfigure.web.WebMvcRegistrationsAdapter 实例源码

项目:spring-rest-client    文件:Application.java   
@Bean
public WebMvcRegistrationsAdapter webMvcRegistrationsAdapter() {
    return new WebMvcRegistrationsAdapter() {
        @Override
        public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
            return new RequestMappingHandlerMapping() {
                @Override
                protected void registerHandlerMethod(Object handler, Method method, RequestMappingInfo mapping) {
                    if (method.getDeclaringClass().isAnnotationPresent(SpringRestClientEnabled.class)) {
                        return; // by pass SpringRestClientEnabled interface
                    }
                    super.registerHandlerMethod(handler, method, mapping);
                }
            };
        }
    };
}
项目:spring-cloud-template    文件:FeignConfig.java   
@Bean
public WebMvcRegistrations feignWebRegistrations() {
    return new WebMvcRegistrationsAdapter() {
        @Override
        public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
            return new FeignRequestMappingHandlerMapping();
        }
    };
}
项目:spring-cloud-sample    文件:FeignConfig.java   
@Bean
public WebMvcRegistrations feignWebRegistrations() {
    return new WebMvcRegistrationsAdapter() {
        @Override
        public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
            return new RequestMappingHandlerMapping() {
                @Override
                protected boolean isHandler(Class<?> beanType) {
                    return super.isHandler(beanType) && (AnnotationUtils.findAnnotation(beanType, FeignClient.class) == null);
                }
            };
        }
    };
}