• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RequestHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中springfox.documentation.RequestHandler的典型用法代码示例。如果您正苦于以下问题:Java RequestHandler类的具体用法?Java RequestHandler怎么用?Java RequestHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RequestHandler类属于springfox.documentation包,在下文中一共展示了RequestHandler类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: basePackages

import springfox.documentation.RequestHandler; //导入依赖的package包/类
@SuppressWarnings("unused")
private static final Predicate<RequestHandler> basePackages(final Class<?>... classes)
{
	final Set<Predicate<RequestHandler>> predicates = new HashSet<>(classes.length);
	for (final Class<?> clazz : classes)
	{
		final String packageName = clazz.getPackage().getName();
		predicates.add(RequestHandlerSelectors.basePackage(packageName));
	}
	
	if(predicates.size() == 1)
	{
		return predicates.iterator().next();
	}

	return Predicates.or(predicates);
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:18,代码来源:SwaggerConfig.java


示例2: api

import springfox.documentation.RequestHandler; //导入依赖的package包/类
@Bean
@Conditional(ActiveProfilesCondition.class)
public Docket api() {
    ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2).select();
    Predicate<RequestHandler> predicate = RequestHandlerSelectors.basePackage(springfoxLoader.getBasePackage())::apply;
    if (springfoxLoader.includeControllers().length > 0) {
        Class<?>[] controllers = springfoxLoader.includeControllers();
        for (Class<?> controller : controllers) {
            Predicate<RequestHandler> includeControllerRequestHandler = RequestHandlerSelectors.basePackage(controller.getPackage().getName())::apply;
            predicate = predicate.or(includeControllerRequestHandler);
        }
    }

    apiSelectorBuilder.apis(predicate::test);

    apiSelectorBuilder.paths(PathSelectors.any()).build().apiInfo(apiInfo()).pathMapping(springfoxLoader.getPath());
    return apiSelectorBuilder.build();
}
 
开发者ID:jarlehansen,项目名称:springfox-loader,代码行数:19,代码来源:SpringfoxLoaderConfig.java


示例3: api

import springfox.documentation.RequestHandler; //导入依赖的package包/类
@Bean
    public Docket api(){
    	Set<Predicate<RequestHandler>> packages = Sets.newHashSet();
    	packages.addAll(getPluginBasePackages());
    	String scanPackageName = getScanPackageName();//ClassUtils.getPackageName(ServiceApplication.class);
    	if(StringUtils.isNotBlank(scanPackageName)){
    		packages.add(RequestHandlerSelectors.basePackage(scanPackageName));
    	}
    	Docket docket = new Docket(DocumentationType.SWAGGER_2)
		    		.ignoredParameterTypes(ApiIgnore.class)
//		    		.pathProvider(pathProvider)
		            .select()
			            .apis(Predicates.or(packages))
			            .paths(PathSelectors.any())
		            .build()
		            .apiInfo(apiInfo());
    	return docket;
    }
 
开发者ID:wayshall,项目名称:onetwo,代码行数:19,代码来源:AutoScanPluginSwaggerConfig.java


示例4: apis

import springfox.documentation.RequestHandler; //导入依赖的package包/类
private Predicate<RequestHandler> apis(Swagger2Properties swagger2Properties) {

        List<Predicate<RequestHandler>> basePackages = new LinkedList<>();

        if (swagger2Properties.getBasePackage().isEmpty()) {
            basePackages.add(RequestHandlerSelectors.any());
        }
        for (String basePackage : swagger2Properties.getBasePackage()) {
            basePackages.add(RequestHandlerSelectors.basePackage(basePackage));
        }

        return Predicates.or(basePackages);
    }
 
开发者ID:xhusky,项目名称:swagger2-spring-boot-starter,代码行数:14,代码来源:Swagger2AutoConfiguration.java


示例5: transform

import springfox.documentation.RequestHandler; //导入依赖的package包/类
private Predicate<RequestHandler> transform(final Predicate<String> pathSelector) {
    return new Predicate<RequestHandler>() {
        @Override
        public boolean apply(RequestHandler input) {
            return Iterables.any(input.getRequestMapping().getPatternsCondition().getPatterns(), pathSelector);
        }
    };
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:9,代码来源:SpringFoxDocket.java


示例6: getDocket

import springfox.documentation.RequestHandler; //导入依赖的package包/类
/**
 * Gets the docket.
 *
 * @param groupName the group name
 * @param pathPattern the path pattern
 * @param apis the apis
 * @param apiinfo the apiinfo
 * @param tag the tag
 * @return the docket
 */
private Docket getDocket(
    String groupName,
    Predicate<String> pathPattern,
    Predicate<RequestHandler> apis,
    ApiInfo apiinfo,
    Tag tag) {
  return new Docket(DocumentationType.SWAGGER_2)
      .groupName(groupName)
      .select()
      .apis(apis)
      .paths(pathPattern)
      .build()
      .apiInfo(apiinfo)
      .pathMapping("/")
      .directModelSubstitute(LocalDate.class, String.class)
      .genericModelSubstitutes(ResponseEntity.class)
      .alternateTypeRules(
          new AlternateTypeRule(
              typeResolver.resolve(
                  DeferredResult.class,
                  typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
              typeResolver.resolve(WildcardType.class)))
      .useDefaultResponseMessages(false)
      .enableUrlTemplating(false)
      .tags(tag);
}
 
开发者ID:balajeetm,项目名称:json-mystique,代码行数:37,代码来源:SwaggerConfiguration.java


示例7: getterMethods

import springfox.documentation.RequestHandler; //导入依赖的package包/类
/**
 * Gets the ter methods.
 *
 * @return the ter methods
 */
private Predicate<RequestHandler> getterMethods() {
  return input -> {
    Set<RequestMethod> methods = input.supportedMethods();
    return CollectionUtils.isEmpty(methods) || methods.contains(RequestMethod.GET);
  };
}
 
开发者ID:balajeetm,项目名称:json-mystique,代码行数:12,代码来源:SwaggerConfiguration.java


示例8: setup

import springfox.documentation.RequestHandler; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    MockitoAnnotations.initMocks(this);

    Method method = this.getClass().getMethod("test", new Class<?>[] { Pageable.class, Integer.class });
    RequestHandler handler = new WebMvcRequestHandler(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);

    resolver = new TypeResolver();
    List<TypeNameProviderPlugin> plugins = new LinkedList<>();
    extractor = new TypeNameExtractor(resolver, SimplePluginRegistry.create(plugins));
    plugin = new PageableParameterBuilderPlugin(extractor, resolver);
}
 
开发者ID:jhipster,项目名称:jhipster,代码行数:17,代码来源:PageableParameterBuilderPluginTest.java


示例9: getPluginBasePackages

import springfox.documentation.RequestHandler; //导入依赖的package包/类
protected Set<Predicate<RequestHandler>> getPluginBasePackages(){
   	if(pluginManager!=null){
    	return pluginManager.getPlugins()
    				.stream()
    				.map(p->RequestHandlerSelectors.basePackage(ClassUtils.getPackageName(p.getRootClass())))
    				.collect(Collectors.toSet());
   	}
   	return Collections.emptySet();
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:10,代码来源:AutoScanPluginSwaggerConfig.java


示例10: modelApiHandlerPredicate

import springfox.documentation.RequestHandler; //导入依赖的package包/类
private Predicate<RequestHandler> modelApiHandlerPredicate() {
    return and(
            withClassAnnotation(RepositoryRestController.class)
    );
}
 
开发者ID:amvnetworks,项目名称:amv-access-api-poc,代码行数:6,代码来源:SwaggerConfiguration.java


示例11: combine

import springfox.documentation.RequestHandler; //导入依赖的package包/类
private Predicate<RequestHandler> combine(Predicate<RequestHandler> requestHandlerSelector, Predicate<String> pathSelector) {
    return Predicates.and(requestHandlerSelector, transform(pathSelector));
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:4,代码来源:SpringFoxDocket.java


示例12: apply

import springfox.documentation.RequestHandler; //导入依赖的package包/类
@Override
public boolean apply(RequestHandler input)
{
   return input.produces().contains(MediaType.APPLICATION_JSON);
}
 
开发者ID:HomeAdvisor,项目名称:Kafdrop,代码行数:6,代码来源:SwaggerConfiguration.java



注:本文中的springfox.documentation.RequestHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CountingIdlingResource类代码示例发布时间:2022-05-22
下一篇:
Java AnonymizableDataType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap