当前位置: 首页>>代码示例>>Java>>正文


Java ViewRenderer类代码示例

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


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

示例1: initialize

import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {

  final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
  bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
  bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
  bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));

  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor()
    )
  );

  bootstrap.addCommand(new OAuth2Command());
  bootstrap.addCommand(new CreateDatabaseCommand(this));
  bootstrap.addCommand(new AddTestdataCommand(this));
}
 
开发者ID:atgse,项目名称:sam,代码行数:20,代码来源:Main.java

示例2: initialize

import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ExampleBootstrapConfigration> bootstrap) {
      //
      bootstrap.addBundle(new AssetsBundle("/templates/css","/css",null,"css"));
      bootstrap.addBundle(new AssetsBundle("/templates/js","/js",null,"js"));
      bootstrap.addBundle(new AssetsBundle("/templates/fonts","/fonts",null,"fonts"));

    ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
    bootstrap.addBundle(new ViewBundle(renderes));

 }
 
开发者ID:deffence1776,项目名称:dropwizard-views-thymeleaf,代码行数:12,代码来源:ExampleBootstrapAppication.java

示例3: configure

import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
protected AppDescriptor configure() {
    final DefaultResourceConfig config = new DefaultResourceConfig();
    final ViewRenderer renderer = new TrimouViewRenderer.Builder().build();
    config.getSingletons().add(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer)));
    config.getSingletons().add(new TestResource());
    return new LowLevelAppDescriptor.Builder(config).build();
}
 
开发者ID:trimou,项目名称:trimou,代码行数:9,代码来源:TrimouViewRendererTest.java

示例4: initialize

import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<BookConfiguration> b) {
    b.addBundle(new ViewBundle(ImmutableList.<ViewRenderer>of(new FreemarkerViewRenderer())));
}
 
开发者ID:JingGe,项目名称:dropwizard,代码行数:5,代码来源:App.java

示例5: initialize

import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
	ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
	bootstrap.addBundle(new ViewBundle(renderes));
	
}
 
开发者ID:deffence1776,项目名称:dropwizard-views-thymeleaf,代码行数:7,代码来源:ExampleApplication.java


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