public class RenderingContext
extends java.lang.Object
ScriptTemplateView
render function in order to make
the application context, the locale, the template loader and the url available on
scripting side.Constructor and Description |
---|
RenderingContext(ApplicationContext applicationContext,
java.util.Locale locale,
java.util.function.Function<java.lang.String,java.lang.String> templateLoader,
java.lang.String url)
Create a new
RenderingContext . |
Modifier and Type | Method and Description |
---|---|
ApplicationContext |
getApplicationContext()
Return the application context.
|
java.util.Locale |
getLocale()
Return the locale of the rendered template.
|
java.util.function.Function<java.lang.String,java.lang.String> |
getTemplateLoader()
Return a function that takes a template path as input and returns the template
content as a String.
|
java.lang.String |
getUrl()
Return the URL of the rendered template.
|
public RenderingContext(ApplicationContext applicationContext, java.util.Locale locale, java.util.function.Function<java.lang.String,java.lang.String> templateLoader, java.lang.String url)
RenderingContext
.applicationContext
- the application contextlocale
- the locale of the rendered templatetemplateLoader
- a function that takes a template path as input and returns
the template content as a Stringurl
- the URL of the rendered templatepublic ApplicationContext getApplicationContext()
public java.util.Locale getLocale()
public java.util.function.Function<java.lang.String,java.lang.String> getTemplateLoader()
public java.lang.String getUrl()