Class TemplateModelFinder
- java.lang.Object
-
- nz.net.ultraq.thymeleaf.layoutdialect.models.TemplateModelFinder
-
public class TemplateModelFinder extends Object
A simple API for retrieving (immutable template) models using Thymeleaf's template manager.- Author:
- zhanhb, Emanuel Rabina
-
-
Constructor Summary
Constructors Constructor Description TemplateModelFinder(ITemplateContext context)Constructor, set the template context we're working in.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateModelfindFragment(String templateName)Return the model specified by the given fragment expression.TemplateModelfindFragment(String templateName, String fragmentName)Return the model specified by the given fragment expression.TemplateModelfindFragment(String templateName, String fragmentName, String dialectPrefix)Return the model specified by the given fragment expression.TemplateModelfindFragment(FragmentExpression fragmentExpression)Return the model specified by the given fragment expression.TemplateModelfindTemplate(String templateName)Return a model for the template specified by the given template name.TemplateModelfindTemplate(FragmentExpression fragmentExpression)Return a model for the template specified by the given fragment expression.ITemplateContextgetContext()
-
-
-
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.
-
getContext
public final ITemplateContext getContext()
-
-