org.springframework.boot.autoconfigure.freemarker.FreeMarkerProperties Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.freemarker.FreeMarkerProperties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FreemarkerRender.java    From BlogManagePlatform with Apache License 2.0 5 votes vote down vote up
@PostConstruct
private void init() {
	configuration = ContextUtil.bean(Configuration.class);
	FreeMarkerProperties properties = ContextUtil.bean(FreeMarkerProperties.class);
	loaderPath = properties.getTemplateLoaderPath()[0];
	suffix = properties.getSuffix();
	for (RenderMode mode : RenderMode.values()) {
		reverterMap.put(mode, ReflectUtil.instance(mode.getReverter()));
	}
	Assert.notNull(configuration, "configuration must not be null");
	Assert.notNull(loaderPath, "loaderPath must not be null");
	Assert.notNull(suffix, "suffix must not be null");
}
 
Example #2
Source File: OghamFreemarkerConfiguration.java    From ogham with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(FreemarkerConfigurer.class)
public FreemarkerConfigurer freemarkerConfigurer(@Qualifier("email") freemarker.template.Configuration emailFreemarkerConfiguration,
												 @Qualifier("sms") freemarker.template.Configuration smsFreemarkerConfiguration,
												 @Autowired(required=false) OghamCommonTemplateProperties templateProperties,
												 @Autowired(required=false) OghamEmailProperties emailProperties,
												 @Autowired(required=false) OghamSmsProperties smsProperties,
												 @Autowired(required=false) FreeMarkerProperties freemarkerProperties,
												 @Autowired(required=false) OghamFreemarkerProperties oghamFreemarkerProperties,
												 @Autowired ApplicationContext applicationContext) {
	return new FreemarkerConfigurer(emailFreemarkerConfiguration, smsFreemarkerConfiguration, templateProperties, emailProperties, smsProperties, freemarkerProperties, oghamFreemarkerProperties, applicationContext);
}
 
Example #3
Source File: FreemarkerConfigurer.java    From ogham with Apache License 2.0 5 votes vote down vote up
public FreemarkerConfigurer(Configuration emailConfiguration, Configuration smsConfiguration, OghamCommonTemplateProperties templateProperties, OghamEmailProperties emailProperties,
		OghamSmsProperties smsProperties, FreeMarkerProperties springProperties, OghamFreemarkerProperties oghamFreemarkerProperties, ApplicationContext applicationContext) {
	super();
	this.emailConfiguration = emailConfiguration;
	this.smsConfiguration = smsConfiguration;
	this.templateProperties = templateProperties;
	this.emailProperties = emailProperties;
	this.smsProperties = smsProperties;
	this.springProperties = springProperties;
	this.oghamFreemarkerProperties = oghamFreemarkerProperties;
	this.applicationContext = applicationContext;
}