
public.javadoc.org.spincast.plugins.pebble.SpincastPebbleTemplatingEngine.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SpincastPebbleTemplatingEngine (org.spincast:spincast-framework 2.1.1 API)
Package org.spincast.plugins.pebble
Class SpincastPebbleTemplatingEngine
java.lang.Object
org.spincast.plugins.pebble.SpincastPebbleTemplatingEngine
- All Implemented Interfaces:
TemplatingEngine
Pebble Html template engine
-
Field Summary
Fields
-
Constructor Summary
Constructors
Constructor
Description
SpincastPebbleTemplatingEngine(SpincastConfig spincastConfig,
SpincastPebbleTemplatingEngineConfig spincastPebbleTemplatingEngineConfig,
Set<com.mitchellbosecke.pebble.extension.Extension> extensions,
JsonManager jsonManager)
-
Method Summary
Modifier and Type
Method
Description
protected void
addCommonLoaderFeatures(com.mitchellbosecke.pebble.PebbleEngine.Builder builder)
createPlaceholder(String variable)
Creates a placeholder using the current templating engine
implementation.
Evaluates the content, without parameters.
Evaluates the content, using the given parameters.
Evaluates the content, using the given parameters.
evaluate(String content,
JsonObject jsonObject)
Evaluates the content, using the given parameters.
evaluate(String content,
JsonObject jsonObject,
Locale locale)
Evaluates the content, using the given parameters.
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params)
Evaluates a template using the given parameters.
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
Locale locale)
Evaluates a template using the given parameters.
fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject jsonObject)
Evaluates a template using the parameters specified
as a JsonObject
.
fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject jsonObject,
Locale locale)
Evaluates a template using the parameters specified
as a JsonObject
.
fromTemplate(String templatePath,
Map<String,Object> params)
Evaluates a template using the given parameters.
Evaluates a template using the given parameters.
fromTemplate(String templatePath,
JsonObject jsonObject)
Evaluates a template using the parameters specified
as a JsonObject
.
fromTemplate(String templatePath,
JsonObject jsonObject,
Locale locale)
Evaluates a template using the parameters specified
as a JsonObject
.
protected com.mitchellbosecke.pebble.loader.Loader<String>
protected Set<com.mitchellbosecke.pebble.extension.Extension>
protected com.mitchellbosecke.pebble.loader.Loader<String>
protected JsonManager
protected com.mitchellbosecke.pebble.PebbleEngine
protected com.mitchellbosecke.pebble.PebbleEngine
protected com.mitchellbosecke.pebble.PebbleEngine
protected SpincastConfig
protected SpincastPebbleTemplatingEngineConfig
protected String
parse(String htmlOrPath,
JsonObject paramsAsJsonObject,
Map<String,Object> params,
boolean isTemplate,
boolean isClasspathPath,
Locale locale)
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
PEBBLE_PARAMS_AS_JSONOBJECT
-
Constructor Details
-
SpincastPebbleTemplatingEngine
@Inject
public SpincastPebbleTemplatingEngine(SpincastConfig spincastConfig,
SpincastPebbleTemplatingEngineConfig spincastPebbleTemplatingEngineConfig,
Set<com.mitchellbosecke.pebble.extension.Extension> extensions,
JsonManager jsonManager)
-
Method Details
-
getSpincastConfig
-
getSpincastPebbleTemplatingEngineConfig
-
getExtensions
-
getJsonManager
-
getPebbleEngineString
protected com.mitchellbosecke.pebble.PebbleEngine getPebbleEngineString()
-
getPebbleEngineTemplateClasspath
protected com.mitchellbosecke.pebble.PebbleEngine getPebbleEngineTemplateClasspath()
-
getPebbleEngineTemplateFileSystem
protected com.mitchellbosecke.pebble.PebbleEngine getPebbleEngineTemplateFileSystem()
-
addCommonLoaderFeatures
protected void addCommonLoaderFeatures(com.mitchellbosecke.pebble.PebbleEngine.Builder builder)
-
getClasspathTemplateLoader
-
getFileSystemTemplateLoader
-
evaluate
Description copied from interface: TemplatingEngine
Evaluates the content, without parameters.
Uses the default Locale.
- Specified by:
evaluate
in interface TemplatingEngine
-
evaluate
Description copied from interface: TemplatingEngine
Evaluates the content, using the given parameters.
specified as a JsonObject
.
Uses the default Locale.
- Specified by:
evaluate
in interface TemplatingEngine
-
evaluate
Description copied from interface: TemplatingEngine
Evaluates the content, using the given parameters.
specified as a JsonObject
.
Uses the specified Locale.
- Specified by:
evaluate
in interface TemplatingEngine
-
evaluate
Description copied from interface: TemplatingEngine
Evaluates the content, using the given parameters.
Uses the default Locale.
- Specified by:
evaluate
in interface TemplatingEngine
-
evaluate
Description copied from interface: TemplatingEngine
Evaluates the content, using the given parameters.
Uses the specified Locale.
- Specified by:
evaluate
in interface TemplatingEngine
-
fromTemplate
Description copied from interface: TemplatingEngine
Evaluates a template using the parameters specified
as a JsonObject
.
Uses the default Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
- Parameters:
templatePath
- must be a classpath's relative path.
-
fromTemplate
Description copied from interface: TemplatingEngine
Evaluates a template using the parameters specified
as a JsonObject
.
Uses the specified Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
- Parameters:
templatePath
- must be a classpath's relative path.
-
fromTemplate
Description copied from interface: TemplatingEngine
Evaluates a template using the parameters specified
as a JsonObject
.
Uses the default Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
isClasspathPath
- if true
, the 'templatePath' is considered as
a classpath's relative path. If false
, it is considered as an absolute file
system path.
-
fromTemplate
public String fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject jsonObject,
Locale locale)
Description copied from interface: TemplatingEngine
Evaluates a template using the parameters specified
as a JsonObject
.
Uses the specified Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
isClasspathPath
- if true
, the 'templatePath' is considered as
a classpath's relative path. If false
, it is considered as an absolute file
system path.
-
fromTemplate
Description copied from interface: TemplatingEngine
Evaluates a template using the given parameters.
Uses the default Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
- Parameters:
templatePath
- must be a classpath's relative path.
-
fromTemplate
Description copied from interface: TemplatingEngine
Evaluates a template using the given parameters.
Uses the specified Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
- Parameters:
templatePath
- must be a classpath's relative path.
-
fromTemplate
Description copied from interface: TemplatingEngine
Evaluates a template using the given parameters.
Uses the default Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
isClasspathPath
- if true
, the 'templatePath' is considered as
a classpath's relative path. If false
, it is considered as an absolute file
system path.
-
fromTemplate
public String fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
Locale locale)
Description copied from interface: TemplatingEngine
Evaluates a template using the given parameters.
Uses the specified Locale.
- Specified by:
fromTemplate
in interface TemplatingEngine
isClasspathPath
- if true
, the 'templatePath' is considered as
a classpath's relative path. If false
, it is considered as an absolute file
system path.
-
parse
-
createPlaceholder
Description copied from interface: TemplatingEngine
Creates a placeholder using the current templating engine
implementation.
This is mainly useful for the tests, which don't know in advance
which templating engine will be used, so which syntax to use
for the placeholders.
For example, using Pebble, a call to createPlaceholder("name")
will
result in "{{name}}
" (without the quotes).
- Specified by:
createPlaceholder
in interface TemplatingEngine
© 2015 - 2025 Weber Informatics LLC | Privacy Policy