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

Java ApiDeclarationProvider类代码示例

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

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



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

示例1: configure

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
@Override
protected void configure() {
  requireBinding(SwaggerConfig.class);

  // Create empty multibinder in case no ModelConverter bindings exist
  Multibinder<ModelConverter> swaggerModelConverterBinder = Multibinder.newSetBinder(
      binder(), ModelConverter.class);

  bind(SwaggerApiResource.class);
  bind(SwaggerUiResource.class);

  bind(ApiDeclarationProvider.class);
  bind(ResourceListingProvider.class);

  bind(JaxrsApiReader.class).to(DefaultJaxrsApiReader.class);
  bind(JaxrsScanner.class).to(SwaggerGuiceJaxrsScanner.class);

  bind(SwaggerLifecycleHook.class).asEagerSingleton();

  install(MultibindingsScanner.asModule());
}
 
开发者ID:cerner,项目名称:beadledom,代码行数:22,代码来源:SwaggerModule.java


示例2: getClasses

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
@Override
public Set<Class<?>> getClasses() {
	Set<Class<?>> classes = new HashSet<Class<?>>();
	classes.add(ApiDeclarationProvider.class);
	classes.add(ApiListingResourceJSON.class);
	classes.add(ResourceListingProvider.class);

	return classes;
}
 
开发者ID:IBMDecisionOptimization,项目名称:DOcloud-GreenTruck-sample,代码行数:10,代码来源:TruckingRestApplication.java


示例3: startServer

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
private static void startServer() throws Exception {
    Object jacksonJaxbJsonProvider = new JacksonJaxbJsonProvider();
    Object crossOriginResourceSharingFilter = new CrossOriginResourceSharingFilter();
    Object customWebApplicationExceptionMapper = new CustomWebApplicationExceptionMapper();
    Object hippoAuthenticationRequestHandler = new HippoAuthenticationRequestHandler();
    Object apiDeclarationProvider = new ApiDeclarationProvider();
    Object resourceListingProvider = new ResourceListingProvider();
    Object customJacksonConfig = new CustomJacksonConfig();

    List<Object> providers = new ArrayList<Object>();
    providers.add(customJacksonConfig);
    providers.add(jacksonJaxbJsonProvider);
    providers.add(crossOriginResourceSharingFilter);
    providers.add(customWebApplicationExceptionMapper);
    providers.add(hippoAuthenticationRequestHandler);
    providers.add(apiDeclarationProvider);
    providers.add(resourceListingProvider);

    List<Class<?>> serviceClasses = new ArrayList<Class<?>>();
    serviceClasses.add(ApiListingResourceJSON.class);
    serviceClasses.add(RootResource.class);
    serviceClasses.add(SystemResource.class);
    serviceClasses.add(NodesResource.class);
    serviceClasses.add(PropertiesResource.class);
    serviceClasses.add(QueryResource.class);
    serviceClasses.add(StatsResource.class);
    serviceClasses.add(UsersResource.class);
    serviceClasses.add(GroupsResource.class);

    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();

    sf.setProviders(providers);
    sf.setResourceClasses(serviceClasses);
    sf.setAddress(HTTP_ENDPOINT_ADDRESS);
    cxfServer = sf.create();
}
 
开发者ID:jreijn,项目名称:hippo-addon-restful-webservices,代码行数:37,代码来源:WebservicesIntegrationTest.java


示例4: init

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
@Override
public void init(Application<? extends ApplicationConfiguration> application) {
	application.addProvider(new ApiDeclarationProvider());
	application.addProvider(new ResourceListingProvider());
	application.addResource(ApiListingResourceJSON.class);
	if (enableCors) {
		application.addFilter(CorsFilter.class);
	}
}
 
开发者ID:minnal,项目名称:minnal,代码行数:10,代码来源:ApiPlugin.java


示例5: shouldAddProvidersOnInit

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
@Test
public void shouldAddProvidersOnInit() {
	apiPlugin = new ApiPlugin(false);
	apiPlugin.init(application);
	verify(application, atLeastOnce()).addProvider(any(ApiDeclarationProvider.class));
	verify(application, atLeastOnce()).addProvider(any(ResourceListingProvider.class));
}
 
开发者ID:minnal,项目名称:minnal,代码行数:8,代码来源:ApiPluginTest.java


示例6: getClasses

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
@Override
public Set<Class<?>> getClasses() {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(AuthenticationResource.class);
    classes.add(InvitationResource.class);
    classes.add(QuestionnaireDefinitionResource.class);
    classes.add(QuestionnaireResource.class);
    classes.add(UserResource.class);
    classes.add(ResearchResource.class);

    classes.add(ApiListingResourceJSON.class);
    classes.add(ResourceListingProvider.class);
    classes.add(ApiDeclarationProvider.class);

    classes.add(JacksonContextResolver.class);
    classes.add(JacksonJsonProvider.class);

    classes.add(LoginShiroFilter.class);
    classes.add(LogoutShiroFilter.class);

    classes.add(ShiroExceptionHandler.class);
    classes.add(AccountNotFoundExceptionHandler.class);
    classes.add(DefaultExceptionHandler.class);

    // Validation feature
    classes.add(ValidationExceptionMapper.class);
    classes.add(JAXRSBeanValidationInInterceptor.class);
    classes.add(JAXRSBeanValidationOutInterceptor.class);
    return classes;
}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:31,代码来源:ApplicationConfig.java


示例7: registerSwagger

import com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider; //导入依赖的package包/类
private void registerSwagger(Environment environment, RestwarsConfiguration configuration) {
    SwaggerConfig swagger = ConfigFactory.config();
    swagger.setApiVersion("1.0.0");
    swagger.setBasePath(configuration.getPublicUrl());

    environment.jersey().register(new ApiListingResourceJSON());
    environment.jersey().register(new ResourceListingProvider());
    environment.jersey().register(new ApiDeclarationProvider());
    ScannerFactory.setScanner(new DefaultJaxrsScanner());
    ClassReaders.setReader(new DefaultJaxrsApiReader());

    FilterFactory.setFilter(new SwaggerFilter());
}
 
开发者ID:phxql,项目名称:restwars,代码行数:14,代码来源:RestwarsApplication.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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