springfox.documentation.spring.web.readers.operation.HandlerMethodResolver Java Examples

The following examples show how to use springfox.documentation.spring.web.readers.operation.HandlerMethodResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebApiApplictionInitalizer.java    From summerframework with Apache License 2.0 6 votes vote down vote up
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
    applicationContext.getBeanFactory().addBeanPostProcessor(new InstantiationAwareBeanPostProcessorAdapter() {
        @Override
        public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
            if (bean instanceof HandlerMethodResolver) {
                HandlerMethodResolver handlerMethodResolver = (HandlerMethodResolver)bean;
                Field typeResolverField =
                    ReflectionUtils.findField(HandlerMethodResolver.class, "typeResolver", TypeResolver.class);
                ReflectionUtils.makeAccessible(typeResolverField);
                TypeResolver typeResolver =
                    (TypeResolver)ReflectionUtils.getField(typeResolverField, handlerMethodResolver);
                return new HandlerMethodResolverWrapper(typeResolver);
            } else {
                return bean;
            }

        }
    });

}
 
Example #2
Source File: PageableParameterBuilderPluginTest.java    From jhipster with Apache License 2.0 6 votes vote down vote up
@BeforeEach
public void setup() throws Exception {
    MockitoAnnotations.initMocks(this);
    Method method = this.getClass().getMethod("test", new Class<?>[]{Pageable.class, Integer.class});
    resolver = new TypeResolver();
    RequestHandler handler = new WebMvcRequestHandler(new HandlerMethodResolver(resolver), null, new
        HandlerMethod(this, method));
    DocumentationContext docContext = mock(DocumentationContext.class);
    RequestMappingContext reqContext = new RequestMappingContext(docContext, handler);
    builder = spy(new OperationBuilder(null));
    context = new OperationContext(builder, RequestMethod.GET, reqContext, 0);
    List<TypeNameProviderPlugin> plugins = new LinkedList<>();
    extractor = new TypeNameExtractor(resolver, SimplePluginRegistry.create(plugins), new
        JacksonEnumTypeDeterminer());
    plugin = new PageableParameterBuilderPlugin(extractor, resolver);
}
 
Example #3
Source File: ApiRequestHandlerProvider.java    From swagger-more with Apache License 2.0 5 votes vote down vote up
@Autowired
public ApiRequestHandlerProvider(List<ServiceBean> serviceBeans,
                                 HandlerMethodResolver methodResolver,
                                 TypeResolver typeResolver) {
    this.serviceBeans = serviceBeans;
    this.methodResolver = methodResolver;
    this.typeResolver = typeResolver;
}
 
Example #4
Source File: ApiRequestHandler.java    From swagger-more with Apache License 2.0 5 votes vote down vote up
ApiRequestHandler(HandlerMethodResolver methodResolver,
                  HandlerMethod handlerMethod,
                  List<ResolvedMethodParameter> resolvedMethodParameters) {
    this.methodResolver = methodResolver;
    this.handlerMethod = handlerMethod;
    this.resolvedMethodParameters = resolvedMethodParameters;
}
 
Example #5
Source File: SpringfoxSupportConfiguration.java    From swagger-more with Apache License 2.0 4 votes vote down vote up
@Bean
public HandlerMethodResolver methodResolver(TypeResolver resolver) {
    return new HandlerMethodResolver(resolver);
}