Search in sources :

Example 1 with DefaultObjectWrapperBuilder

use of freemarker.template.DefaultObjectWrapperBuilder in project moco by dreamhead.

the class TemplateResourceReader method createConfiguration.

private Configuration createConfiguration(final TemplateLoader templateLoader, final Charset charset) {
    Configuration cfg = new Configuration(CURRENT_VERSION);
    cfg.setObjectWrapper(new DefaultObjectWrapperBuilder(CURRENT_VERSION).build());
    cfg.setDefaultEncoding(charset.name());
    cfg.setTemplateLoader(templateLoader);
    return cfg;
}
Also used : Configuration(freemarker.template.Configuration) DefaultObjectWrapperBuilder(freemarker.template.DefaultObjectWrapperBuilder)

Example 2 with DefaultObjectWrapperBuilder

use of freemarker.template.DefaultObjectWrapperBuilder in project ninja by ninjaframework.

the class TemplateEngineFreemarker method createBeansWrapperWithExposedFields.

private BeansWrapper createBeansWrapperWithExposedFields() {
    DefaultObjectWrapperBuilder defaultObjectWrapperBuilder = new DefaultObjectWrapperBuilder(INCOMPATIBLE_IMPROVEMENTS_VERSION);
    defaultObjectWrapperBuilder.setExposeFields(true);
    DefaultObjectWrapper defaultObjectWrapper = defaultObjectWrapperBuilder.build();
    return defaultObjectWrapper;
}
Also used : DefaultObjectWrapper(freemarker.template.DefaultObjectWrapper) DefaultObjectWrapperBuilder(freemarker.template.DefaultObjectWrapperBuilder)

Example 3 with DefaultObjectWrapperBuilder

use of freemarker.template.DefaultObjectWrapperBuilder in project spring-framework by spring-projects.

the class FreeMarkerView method getObjectWrapper.

/**
	 * Return the configured FreeMarker {@link ObjectWrapper}, or the
	 * {@link ObjectWrapper#DEFAULT_WRAPPER default wrapper} if none specified.
	 * @see freemarker.template.Configuration#getObjectWrapper()
	 */
protected ObjectWrapper getObjectWrapper() {
    ObjectWrapper ow = getConfiguration().getObjectWrapper();
    Version version = Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS;
    return (ow != null ? ow : new DefaultObjectWrapperBuilder(version).build());
}
Also used : Version(freemarker.template.Version) ObjectWrapper(freemarker.template.ObjectWrapper) DefaultObjectWrapperBuilder(freemarker.template.DefaultObjectWrapperBuilder)

Aggregations

DefaultObjectWrapperBuilder (freemarker.template.DefaultObjectWrapperBuilder)3 Configuration (freemarker.template.Configuration)1 DefaultObjectWrapper (freemarker.template.DefaultObjectWrapper)1 ObjectWrapper (freemarker.template.ObjectWrapper)1 Version (freemarker.template.Version)1