Class MustacheWebConfiguration


  • @Configuration
    @PropertySource(value="classpath:mustache.properties",
                    ignoreResourceNotFound=true)
    public class MustacheWebConfiguration
    extends Object
    • 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 of MustacheCompiler to be created.
        Returns:
        Mustache view resolver instance.
      • getPrefix

        public String getPrefix()
        Resolve views prefix value. Default is to look for "mustache.prefix" property or use MustacheSettings.PREFIX if property cannot be resolved.
        Returns:
        Prefix value.
      • getSuffix

        public String getSuffix()
        Resolve views suffix value. Default is to look for "mustache.suffix" property or use MustacheSettings.SUFFIX if 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 use MustacheSettings.ORDER if 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 use MustacheSettings.CACHE if 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 use MustacheSettings.VIEW_NAMES if property cannot be resolved.
        Returns:
        View names patterns.
      • getLayoutMappings

        public Map<String,​String> getLayoutMappings()
        Get mappings to use with resolvers.
        Returns:
        Layouts mappings