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


Java DefaultObjectWrapperBuilder.setExposeFields方法代码示例

本文整理汇总了Java中freemarker.template.DefaultObjectWrapperBuilder.setExposeFields方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultObjectWrapperBuilder.setExposeFields方法的具体用法?Java DefaultObjectWrapperBuilder.setExposeFields怎么用?Java DefaultObjectWrapperBuilder.setExposeFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在freemarker.template.DefaultObjectWrapperBuilder的用法示例。


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

示例1: createFreeMarkerConfiguration

import freemarker.template.DefaultObjectWrapperBuilder; //导入方法依赖的package包/类
/**
 * Creates a new FreeMarker configuration.
 * By default, it is configured as follows:
 * <ul>
 * <li>compatibility level is set to 2.3.23
 * <li>the object wrapper is configured to expose fields
 * <li>API builtins are enabled
 * <li>there are 2 template loaders - 1 for loading templates from /META-INF using a classloader and a second
 *     one to load templates from files.
 * </ul>
 * @return
 */
protected Configuration createFreeMarkerConfiguration() {
    DefaultObjectWrapperBuilder bld = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_23);
    bld.setExposeFields(true);

    Configuration freeMarker = new Configuration(Configuration.VERSION_2_3_23);

    freeMarker.setObjectWrapper(bld.build());
    freeMarker.setAPIBuiltinEnabled(true);
    freeMarker.setTemplateLoader(new MultiTemplateLoader(
            new TemplateLoader[]{new ClassTemplateLoader(getClass(), "/META-INF"),
                    new NaiveFileTemplateLoader()}));

    return freeMarker;
}
 
开发者ID:revapi,项目名称:revapi,代码行数:27,代码来源:TextReporter.java

示例2: Environment

import freemarker.template.DefaultObjectWrapperBuilder; //导入方法依赖的package包/类
private Environment() {
    Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
    // Specify the data source where the template files come from.
    cfg.setClassForTemplateLoading(getClass(), "/templates/");
    DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_23);
    builder.setExposeFields(true);
    cfg.setObjectWrapper(builder.build());
    freemarkerConfig = cfg;
    
    fmHelper = new FreeMarkerHelper();
    templateCache = new ConcurrentHashMap<String, Template>();

    symbols = new ConcurrentHashMap<String, String>();

    textFormatter = new TextFormatter();

    xmlFormatter = new XMLFormatter();
    nsContext = new NamespaceContextImpl();
    fillNamespaceContext();
    xPathHelper = new XPathHelper();

    jsonPathHelper = new JsonPathHelper();
    jsonHelper = new JsonHelper();

    htmlCleaner = new HtmlCleaner();

    httpClient = new HttpClient();

    programHelper = new ProgramHelper();
    programHelper.setTimeoutHelper(timeoutHelper);
    configDatesHelper();

    driverManager = new DriverManager();
    cookieConverter = new CookieConverter();
}
 
开发者ID:fhoeben,项目名称:hsac-fitnesse-fixtures,代码行数:36,代码来源:Environment.java


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