Class MustacheWebConfiguration
- java.lang.Object
-
- com.github.mjeanroy.springmvc.view.mustache.configuration.MustacheWebConfiguration
-
@Configuration @PropertySource(value="classpath:mustache.properties", ignoreResourceNotFound=true) public class MustacheWebConfiguration extends Object
-
-
Constructor Summary
Constructors Constructor Description MustacheWebConfiguration(org.springframework.core.env.Environment environment, MustacheCompiler mustacheCompiler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCache()Resolve mustache view resolver cache settings.StringgetDefaultLayout()Resolve default layout to use.StringgetLayoutKey()Resolve default key to use as partials alias in default view layout.Map<String,String>getLayoutMappings()Get mappings to use with resolvers.intgetOrder()Resolve mustache view resolver order.StringgetPrefix()Resolve views prefix value.StringgetSuffix()Resolve views suffix value.String[]getViewNames()Resolve view names matchers of mustache view resolver.MustacheViewResolvermustacheViewResolver()Build mustache view resolver.
-
-
-
Constructor Detail
-
MustacheWebConfiguration
@Autowired public MustacheWebConfiguration(org.springframework.core.env.Environment environment, MustacheCompiler mustacheCompiler)
-
-
Method Detail
-
mustacheViewResolver
@Bean @Conditional(com.github.mjeanroy.springmvc.view.mustache.configuration.MustacheWebConfiguration.MustacheViewResolverCondition.class) public MustacheViewResolver mustacheViewResolver()
Build mustache view resolver. This view resolver needs an instance ofMustacheCompilerto be created.- Returns:
- Mustache view resolver instance.
-
getPrefix
public String getPrefix()
Resolve views prefix value. Default is to look for "mustache.prefix" property or useMustacheSettings.PREFIXif property cannot be resolved.- Returns:
- Prefix value.
-
getSuffix
public String getSuffix()
Resolve views suffix value. Default is to look for "mustache.suffix" property or useMustacheSettings.SUFFIXif property cannot be resolved.- Returns:
- Suffix value.
-
getOrder
public int getOrder()
Resolve mustache view resolver order. Default is to look for "mustache.order" property or useMustacheSettings.ORDERif property cannot be resolved.- Returns:
- Order value.
-
getCache
public boolean getCache()
Resolve mustache view resolver cache settings. Default is to look for "mustache.cache" property or useMustacheSettings.CACHEif property cannot be resolved.- Returns:
- Cache settings.
-
getDefaultLayout
public String getDefaultLayout()
Resolve default layout to use. This layout can be used to define template to be used as main layout and render view within this layout.- Returns:
- Layout name.
-
getLayoutKey
public String getLayoutKey()
Resolve default key to use as partials alias in default view layout.- Returns:
- Partial key in layout.
-
getViewNames
public String[] getViewNames()
Resolve view names matchers of mustache view resolver. Default is to look for "mustache.viewNames" property or useMustacheSettings.VIEW_NAMESif property cannot be resolved.- Returns:
- View names patterns.
-
-