當前位置: 首頁>>代碼示例>>Java>>正文


Java BeanConfig.setContact方法代碼示例

本文整理匯總了Java中io.swagger.jaxrs.config.BeanConfig.setContact方法的典型用法代碼示例。如果您正苦於以下問題:Java BeanConfig.setContact方法的具體用法?Java BeanConfig.setContact怎麽用?Java BeanConfig.setContact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.swagger.jaxrs.config.BeanConfig的用法示例。


在下文中一共展示了BeanConfig.setContact方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: activate

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
@Override
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {

    InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(SwaggerArchive.SWAGGER_CONFIGURATION_PATH);

    if (in == null) {
        // No config available. Print a warning and return
        System.err.println("WARN: No swagger configuration found. Swagger not activated.");
        return;
    }
    SwaggerConfig config = new SwaggerConfig(in);

    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setHost((String) config.get(SwaggerConfig.Key.HOST));
    beanConfig.setLicense((String) config.get(SwaggerConfig.Key.LICENSE));
    beanConfig.setLicenseUrl((String) config.get(SwaggerConfig.Key.LICENSE_URL));
    beanConfig.setTermsOfServiceUrl((String) config.get(SwaggerConfig.Key.TERMS_OF_SERVICE_URL));
    beanConfig.setResourcePackage((String) config.get(SwaggerConfig.Key.PACKAGES));
    beanConfig.setVersion((String) config.get(SwaggerConfig.Key.VERSION));
    beanConfig.setBasePath((String) config.get(SwaggerConfig.Key.ROOT));
    beanConfig.setContact((String) config.get(SwaggerConfig.Key.CONTACT));
    beanConfig.setDescription((String) config.get(SwaggerConfig.Key.DESCRIPTION));
    beanConfig.setTitle((String) config.get(SwaggerConfig.Key.TITLE));
    beanConfig.setPrettyPrint((String) config.get(SwaggerConfig.Key.PRETTY_PRINT));
    beanConfig.setSchemes((String[]) config.get(SwaggerConfig.Key.SCHEMES));

    beanConfig.setScan(true);

}
 
開發者ID:wildfly-swarm-archive,項目名稱:ARCHIVE-wildfly-swarm,代碼行數:30,代碼來源:SwaggerActivator.java

示例2: swaggerConfig

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
@Bean
public BeanConfig swaggerConfig() {
	final BeanConfig beanConfig = new BeanConfig();
	beanConfig.setResourcePackage("com.github.sbugat.samplerest.resource");
	beanConfig.setVersion("1.0.0");
	beanConfig.setHost("localhost:8080");
	beanConfig.setBasePath(servletContext.getContextPath());
	beanConfig.setTitle("Swagger CXF, JAX-RS 2.0 sample");
	beanConfig.setDescription("This is a Swagger CXF, JAX-RS 2.0 sample API.");
	beanConfig.setContact("Sylvain Bugat");
	beanConfig.setLicense("Apache 2.0");
	beanConfig.setLicenseUrl("https://github.com/Sylvain-Bugat/swagger-cxf-rest-skeleton/blob/master/LICENSE");

	beanConfig.getSwagger().addSecurityDefinition("api_token", new ApiKeyAuthDefinition("api_token", In.HEADER));

	beanConfig.setScan(true);

	return beanConfig;
}
 
開發者ID:Sylvain-Bugat,項目名稱:swagger-cxf-rest-skeleton,代碼行數:20,代碼來源:ApplicationConfiguration.java

示例3: configureSwagger

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private void configureSwagger() {
	// Available at localhost:port/swagger.json
	this.register(ApiListingResource.class);
	this.register(SwaggerSerializers.class);

	BeanConfig config = new BeanConfig();
	// config.setConfigId(title);
	config.setTitle(title);
	config.setDescription(description);
	config.setVersion(version);
	config.setContact(contact);
	config.setSchemes(schemes.split(","));
	config.setBasePath(basePath);
	config.setResourcePackage(resourcePackage);
	config.setPrettyPrint(prettyPrint);
	config.setScan(scan);	
}
 
開發者ID:jotorren,項目名稱:microservices-transactions-tcc,代碼行數:18,代碼來源:WebServicesConfiguration.java

示例4: getBeanConfig

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private BeanConfig getBeanConfig() {
    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setHost(getConfig("swagger.host"));
    beanConfig.setSchemes(getConfig("swagger.schemes").split(","));
    beanConfig.setTitle(getConfig("swagger.title"));
    beanConfig.setVersion(getConfig("swagger.version"));
    beanConfig.setContact(getConfig("swagger.contact"));
    beanConfig.setLicense(getConfig("swagger.license"));
    beanConfig.setBasePath(getConfig("swagger.base_path"));
    beanConfig.setLicenseUrl(getConfig("swagger.licenseUrl"));
    beanConfig.setDescription(getConfig("swagger.description"));
    beanConfig.setPrettyPrint(getConfig("swagger.pretty_print"));
    beanConfig.setTermsOfServiceUrl(getConfig("swagger.terms_of_service_url"));

    // Must be called last
    beanConfig.setResourcePackage(resourcePackages());
    beanConfig.setScan(true);

    return beanConfig;
}
 
開發者ID:labsai,項目名稱:EDDI,代碼行數:21,代碼來源:SwaggerServletContextListener.java

示例5: bildSwaggerConfig

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private void bildSwaggerConfig() {
    BeanConfig beanConfig = new BeanConfig();
    //beanConfig.setConfigId("configId: " + contextId++);
    beanConfig.setTitle("Bagri REST server");
    beanConfig.setDescription("goto http://bagridb.com for more info");
    beanConfig.setContact("[email protected]");
    beanConfig.setLicense("Apache 2.0");
    beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
    beanConfig.setVersion(bg_version);
    beanConfig.setSchemes(new String[] {"http", "https"});
    // TODO: get host info somehow..
    beanConfig.setHost("localhost:" + port);
    beanConfig.setBasePath("/"); // /api
    beanConfig.setResourcePackage("com.bagri.rest.service");
    beanConfig.setPrettyPrint(true);
    // force Swagger to re-scan the package mentioned above and use 
    // custom ReaderListener from that package
    beanConfig.setScan(true);
}
 
開發者ID:dsukhoroslov,項目名稱:bagri,代碼行數:20,代碼來源:BagriRestServer.java

示例6: setupSwagger

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private void setupSwagger(HttpServer httpServer) {
  BeanConfig beanConfig = new BeanConfig();
  beanConfig.setTitle("Pinot Controller API");
  beanConfig.setDescription("APIs for accessing Pinot Controller information");
  beanConfig.setContact("https://github.com/linkedin/pinot");
  beanConfig.setVersion("1.0");
  beanConfig.setSchemes(new String[]{"http"});
  beanConfig.setBasePath(baseUri.getPath());
  beanConfig.setResourcePackage(RESOURCE_PACKAGE);
  beanConfig.setScan(true);

  CLStaticHttpHandler apiStaticHttpHandler = new CLStaticHttpHandler(ControllerAdminApiApplication.class.getClassLoader(),
      "/api/");
  // map both /api and /help to swagger docs. /api because it looks nice. /help for backward compatibility
  httpServer.getServerConfiguration().addHttpHandler(apiStaticHttpHandler, "/api");
  httpServer.getServerConfiguration().addHttpHandler(apiStaticHttpHandler, "/help");

  URL swaggerDistLocation = ControllerAdminApiApplication.class.getClassLoader()
      .getResource("META-INF/resources/webjars/swagger-ui/2.2.2/");
  CLStaticHttpHandler swaggerDist = new CLStaticHttpHandler(
      new URLClassLoader(new URL[] {swaggerDistLocation}));
  httpServer.getServerConfiguration().addHttpHandler(swaggerDist, "/swaggerui-dist/");
}
 
開發者ID:linkedin,項目名稱:pinot,代碼行數:24,代碼來源:ControllerAdminApiApplication.java

示例7: setupSwagger

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private void setupSwagger(HttpServer httpServer) {
  BeanConfig beanConfig = new BeanConfig();
  beanConfig.setTitle("Pinot Broker API");
  beanConfig.setDescription("APIs for accessing Pinot broker information");
  beanConfig.setContact("https://github.com/linkedin/pinot");
  beanConfig.setVersion("1.0");
  beanConfig.setSchemes(new String[]{"http"});
  beanConfig.setBasePath(baseUri.getPath());
  beanConfig.setResourcePackage(RESOURCE_PACKAGE);
  beanConfig.setScan(true);

  CLStaticHttpHandler staticHttpHandler =
      new CLStaticHttpHandler(BrokerAdminApiApplication.class.getClassLoader(), "/api/");
  // map both /api and /help to swagger docs. /api because it looks nice. /help for backward compatibility
  httpServer.getServerConfiguration().addHttpHandler(staticHttpHandler, "/api");
  httpServer.getServerConfiguration().addHttpHandler(staticHttpHandler, "/help");

  URL swaggerDistLocation =
      BrokerAdminApiApplication.class.getClassLoader().getResource("META-INF/resources/webjars/swagger-ui/2.2.2/");
  CLStaticHttpHandler swaggerDist = new CLStaticHttpHandler(new URLClassLoader(new URL[]{swaggerDistLocation}));
  httpServer.getServerConfiguration().addHttpHandler(swaggerDist, "/swaggerui-dist/");
}
 
開發者ID:linkedin,項目名稱:pinot,代碼行數:23,代碼來源:BrokerAdminApiApplication.java

示例8: setupSwagger

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private void setupSwagger(HttpServer httpServer) {
  BeanConfig beanConfig = new BeanConfig();
  beanConfig.setTitle("Pinot Server API");
  beanConfig.setDescription("APIs for accessing Pinot server information");
  beanConfig.setContact("https://github.com/linkedin/pinot");
  beanConfig.setVersion("1.0");
  beanConfig.setSchemes(new String[]{"http"});
  beanConfig.setBasePath(baseUri.getPath());
  beanConfig.setResourcePackage(RESOURCE_PACKAGE);
  beanConfig.setScan(true);

  CLStaticHttpHandler staticHttpHandler = new CLStaticHttpHandler(AdminApiApplication.class.getClassLoader(), "/api/");
  // map both /api and /help to swagger docs. /api because it looks nice. /help for backward compatibility
  httpServer.getServerConfiguration().addHttpHandler(staticHttpHandler, "/api");
  httpServer.getServerConfiguration().addHttpHandler(staticHttpHandler, "/help");

  URL swaggerDistLocation = AdminApiApplication.class.getClassLoader()
      .getResource("META-INF/resources/webjars/swagger-ui/2.2.2/");
  CLStaticHttpHandler swaggerDist = new CLStaticHttpHandler(
      new URLClassLoader(new URL[] {swaggerDistLocation}));
  httpServer.getServerConfiguration().addHttpHandler(swaggerDist, "/swaggerui-dist/");
}
 
開發者ID:linkedin,項目名稱:pinot,代碼行數:23,代碼來源:AdminApiApplication.java

示例9: registerSwagger

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
@PostConstruct
private void registerSwagger() throws IOException {
    BeanConfig swaggerConfig = new BeanConfig();
    swaggerConfig.setTitle("Cloudbreak API");
    swaggerConfig.setDescription(FileReaderUtils.readFileFromClasspath("swagger/cloudbreak-introduction"));
    if (Strings.isNullOrEmpty(cbVersion)) {
        swaggerConfig.setVersion(VERSION_UNAVAILABLE);
    } else {
        swaggerConfig.setVersion(cbVersion);
    }
    swaggerConfig.setSchemes(new String[]{"http", "https"});
    swaggerConfig.setBasePath(CoreApi.API_ROOT_CONTEXT);
    swaggerConfig.setLicenseUrl("https://github.com/sequenceiq/cloudbreak/blob/master/LICENSE");
    swaggerConfig.setResourcePackage("com.sequenceiq.cloudbreak.api");
    swaggerConfig.setScan(true);
    swaggerConfig.setContact("https://hortonworks.com/contact-sales/");
    swaggerConfig.setPrettyPrint(true);
    SwaggerConfigLocator.getInstance().putConfig(SwaggerContextService.CONFIG_ID_DEFAULT, swaggerConfig);
}
 
開發者ID:hortonworks,項目名稱:cloudbreak,代碼行數:20,代碼來源:EndpointConfig.java

示例10: Application

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
public Application() {
	super(Settings.WEB_ROOT_PACKAGE_NAME + ".jersey");
	BeanConfig beanConfig = new BeanConfig();
	beanConfig.setSchemes(new String[] { WebUtil.getHttpScheme() });
	beanConfig.setHost(WebUtil.getHttpHost());
	beanConfig.setBasePath("/" + WebUtil.REST_API_PATH);
	beanConfig.setTitle(Settings.getString(SettingCodes.API_TITLE, Bundle.SETTINGS, DefaultSettings.API_TITLE));
	// beanConfig.setDescription(Settings.getString(SettingCodes.API_INSTANCE, Bundle.SETTINGS, DefaultSettings.API_INSTANCE));
	beanConfig.setVersion(Settings.getString(SettingCodes.API_VERSION, Bundle.SETTINGS, DefaultSettings.API_VERSION));
	beanConfig.setContact(Settings.getContactEmail());
	// beanConfig.setResourcePackage("io.swagger.resources");
	beanConfig.setResourcePackage(Settings.WEB_ROOT_PACKAGE_NAME + ".jersey.resource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.HyperlinkResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.course.CourseResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.inventory.InventoryResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.staff.StaffResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.SearchResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.VisitResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.proband.ProbandResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.inputfield.InputFieldResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.VisitScheduleItemResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.user.UserResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.InquiryResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.FileResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.ProbandListEntryResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.ProbandListEntryTagResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.ProbandListEntryTagValuesResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.ProbandListStatusEntryResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.JournalResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.proband.InquiryValuesResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.IndexResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.SelectionSetResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.shared.ToolsResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.inputfield.SelectionSetValueResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.ProbandGroupResource");
	// beanConfig.setResourcePackage("org.phoenixctms.ctsms.web.jersey.resource.trial.TrialResource");
	beanConfig.setScan(true);
}
 
開發者ID:phoenixctms,項目名稱:ctsms,代碼行數:39,代碼來源:Application.java

示例11: JaxRsActivator

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
public JaxRsActivator() {
	BeanConfig beanConfig = new BeanConfig();
	beanConfig.setVersion("1.0.0");
	beanConfig.setSchemes(new String[] { "http" });
	beanConfig.setTitle("Hola microservices REST API");
	beanConfig.setDescription("Operations that can be invoked in the hola microservices");
	beanConfig.setResourcePackage("com.redhat.developers.msa.hola");
	beanConfig.setLicense("Apache 2.0");
	beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
	beanConfig.setContact("[email protected]");
	beanConfig.setBasePath("/api");
	beanConfig.setPrettyPrint(true);
	beanConfig.setScan(true);
}
 
開發者ID:redhat-developer-demos,項目名稱:the-deploy-master,代碼行數:15,代碼來源:JaxRsActivator.java

示例12: JaxRsActivator

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
public JaxRsActivator() {
	BeanConfig beanConfig = new BeanConfig();
       beanConfig.setVersion("1.0.0");
       beanConfig.setSchemes(new String[] { "http" });
       beanConfig.setTitle("The Deploy Master demo REST API");
       beanConfig.setDescription("Operations that can be invoked in this demo");
       beanConfig.setResourcePackage("com.redhat.developers.rest");
       beanConfig.setLicense("Apache 2.0");
       beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
       beanConfig.setContact("[email protected]");
       beanConfig.setBasePath("/demo/api");
       beanConfig.setPrettyPrint(true);
       beanConfig.setScan(true);
}
 
開發者ID:redhat-developer-demos,項目名稱:the-deploy-master,代碼行數:15,代碼來源:JaxRsActivator.java

示例13: contextInitialized

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
@Override
public void contextInitialized(ServletContextEvent sce) {
    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setVersion("1.0.0");
    beanConfig.setSchemes(new String[] { "http" });
    beanConfig.setTitle("Hola microservices REST API");
    beanConfig.setDescription("Operations that can be invoked in the hola microservices");
    beanConfig.setResourcePackage("com.redhat.developers.msa.hola");
    beanConfig.setLicense("Apache 2.0");
    beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
    beanConfig.setContact("[email protected]");
    beanConfig.setBasePath("/api");
    beanConfig.setPrettyPrint(true);
    beanConfig.setScan(true);
}
 
開發者ID:redhat-helloworld-msa,項目名稱:hola,代碼行數:16,代碼來源:SwaggerListener.java

示例14: contextInitialized

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
@Override
public void contextInitialized(ServletContextEvent sce) {
    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setVersion("1.0.0");
    beanConfig.setSchemes(new String[] { "http" });
    beanConfig.setTitle("Hello microservices REST API");
    beanConfig.setDescription("Operations that can be invoked in the hello microservices");
    beanConfig.setResourcePackage("com.redhat.developers.msa.hello");
    beanConfig.setLicense("Apache 2.0");
    beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
    beanConfig.setContact("[email protected]");
    beanConfig.setBasePath("/api");
    beanConfig.setPrettyPrint(true);
    beanConfig.setScan(true);
}
 
開發者ID:redhat-helloworld-msa,項目名稱:hello,代碼行數:16,代碼來源:SwaggerListener.java

示例15: configureSwagger

import io.swagger.jaxrs.config.BeanConfig; //導入方法依賴的package包/類
private void configureSwagger() {
	this.register(ApiListingResource.class);
	this.register(SwaggerSerializers.class);

	BeanConfig config = new BeanConfig();
	config.setTitle("POC - Restful API by Spring Boot, Jersey, Swagger");
	config.setVersion("v1");
	config.setContact("Bright Zheng");
	config.setSchemes(new String[] { "http", "https" });
	config.setBasePath(this.apiPath);
	config.setResourcePackage("bright.zheng.poc.api.resources");
	config.setPrettyPrint(true);
	config.setScan(true);
}
 
開發者ID:brightzheng100,項目名稱:springboot-jersey-swagger,代碼行數:15,代碼來源:JerseyConfig.java


注:本文中的io.swagger.jaxrs.config.BeanConfig.setContact方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。