Class TemplateModelFinder


  • public class TemplateModelFinder
    extends Object
    A simple API for retrieving (immutable template) models using Thymeleaf's template manager.
    Author:
    zhanhb, Emanuel Rabina
    • Constructor Detail

      • TemplateModelFinder

        public TemplateModelFinder​(ITemplateContext context)
        Constructor, set the template context we're working in.
        Parameters:
        context -
    • Method Detail

      • findFragment

        public TemplateModel findFragment​(FragmentExpression fragmentExpression)
        Return the model specified by the given fragment expression.
        Parameters:
        fragmentExpression -
        Returns:
        Fragment matching the fragment specification.
      • findFragment

        public TemplateModel findFragment​(String templateName,
                                          String fragmentName,
                                          String dialectPrefix)
        Return the model specified by the given fragment expression.
        Parameters:
        templateName -
        fragmentName -
        dialectPrefix -
        Returns:
        Fragment matching the fragment specification.
      • findFragment

        public TemplateModel findFragment​(String templateName,
                                          String fragmentName)
        Return the model specified by the given fragment expression.
        Parameters:
        templateName -
        fragmentName -
        Returns:
        Fragment matching the fragment specification.
      • findFragment

        public TemplateModel findFragment​(String templateName)
        Return the model specified by the given fragment expression.
        Parameters:
        templateName -
        Returns:
        Fragment matching the fragment specification.
      • findTemplate

        public TemplateModel findTemplate​(FragmentExpression fragmentExpression)
        Return a model for the template specified by the given fragment expression.
        Parameters:
        fragmentExpression -
        Returns:
        Template model matching the fragment specification.
      • findTemplate

        public TemplateModel findTemplate​(String templateName)
        Return a model for the template specified by the given template name.
        Parameters:
        templateName -
        Returns:
        Template model matching the fragment specification.