org.jtwig.spring.boot.JtwigProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtwig-spring-boot-starter Show documentation
Show all versions of jtwig-spring-boot-starter Show documentation
Jtwig jtwig-spring-boot-starter
The newest version!
package org.jtwig.spring.boot;
import org.jtwig.spring.JtwigViewResolver;
import org.springframework.boot.autoconfigure.template.AbstractTemplateViewResolverProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import static org.springframework.util.Assert.isInstanceOf;
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "jtwig")
public class JtwigProperties extends AbstractTemplateViewResolverProperties {
static final String DEFAULT_PREFIX = "classpath:/templates/";
static final String DEFAULT_SUFFIX = ".twig";
public JtwigProperties() {
super(DEFAULT_PREFIX, DEFAULT_SUFFIX);
this.setCache(true);
}
@Override
public void applyToMvcViewResolver(Object viewResolver) {
super.applyToMvcViewResolver(viewResolver);
isInstanceOf(JtwigViewResolver.class, viewResolver,
"ViewResolver is not an instance of JtwigViewResolver :" + viewResolver);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy