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.
The newest version!
SpincastPebbleTemplatingEngine (org.spincast:spincast-framework 0.9.28 API)
org.spincast.plugins.pebble
Class SpincastPebbleTemplatingEngine
- java.lang.Object
-
- org.spincast.plugins.pebble.SpincastPebbleTemplatingEngine
-
- All Implemented Interfaces:
- ITemplatingEngine
public class SpincastPebbleTemplatingEngine
extends Object
implements ITemplatingEngine
Pebble Html template engine
-
-
Constructor Summary
Constructors
Constructor and Description
SpincastPebbleTemplatingEngine(ISpincastConfig spincastConfig,
ISpincastPebbleTemplatingEngineConfig spincastPebbleTemplatingEngineConfig,
ISpincastPebbleExtension spincastPebbleExtension)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
protected void
addCommonLoaderFeatures(com.mitchellbosecke.pebble.PebbleEngine.Builder builder)
protected Map<String,Object>
convertJsonObjectToMap(IJsonObject jsonObject)
Converts a IJsonObject to a Map<String, Object>, but only
the first level, only so it can be pass to the Pebble templating
engine which requires a Map<String, Object>.
String
createPlaceholder(String variable)
Creates a placeholder using the current templating engine
implementation.
String
evaluate(String content,
IJsonObject jsonObject)
Evaluates the content, using the given parameters.
String
evaluate(String content,
IJsonObject jsonObject,
Locale locale)
Evaluates the content, using the given parameters.
String
evaluate(String content,
Map<String,Object> params)
Evaluates the content, using the given parameters.
String
evaluate(String content,
Map<String,Object> params,
Locale locale)
Evaluates the content, using the given parameters.
String
fromTemplate(String templatePath,
boolean isClasspathPath,
IJsonObject jsonObject)
Evaluates a template using the parameters specified
as a IJsonObject.
String
fromTemplate(String templatePath,
boolean isClasspathPath,
IJsonObject jsonObject,
Locale locale)
Evaluates a template using the parameters specified
as a IJsonObject.
String
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params)
Evaluates a template using the given parameters.
String
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
Locale locale)
Evaluates a template using the given parameters.
String
fromTemplate(String templatePath,
IJsonObject jsonObject)
Evaluates a template using the parameters specified
as a IJsonObject.
String
fromTemplate(String templatePath,
IJsonObject jsonObject,
Locale locale)
Evaluates a template using the parameters specified
as a IJsonObject.
String
fromTemplate(String templatePath,
Map<String,Object> params)
Evaluates a template using the given parameters.
String
fromTemplate(String templatePath,
Map<String,Object> params,
Locale locale)
Evaluates a template using the given parameters.
protected com.mitchellbosecke.pebble.loader.Loader<String>
getClasspathTemplateLoader()
protected com.mitchellbosecke.pebble.loader.Loader<String>
getFileSystemTemplateLoader()
protected com.mitchellbosecke.pebble.PebbleEngine
getPebbleEngineString()
protected com.mitchellbosecke.pebble.PebbleEngine
getPebbleEngineTemplateClasspath()
protected com.mitchellbosecke.pebble.PebbleEngine
getPebbleEngineTemplateFileSystem()
protected ISpincastConfig
getSpincastConfig()
protected ISpincastPebbleExtension
getSpincastPebbleExtension()
protected ISpincastPebbleTemplatingEngineConfig
getSpincastPebbleTemplatingEngineConfig()
protected String
parse(String htmlOrPath,
Map<String,Object> params,
boolean isTemplate,
boolean isClasspathPath,
Locale locale)
-
-
Constructor Detail
-
SpincastPebbleTemplatingEngine
@Inject
public SpincastPebbleTemplatingEngine(ISpincastConfig spincastConfig,
ISpincastPebbleTemplatingEngineConfig spincastPebbleTemplatingEngineConfig,
@Nullable
ISpincastPebbleExtension spincastPebbleExtension)
-
Method Detail
-
getSpincastConfig
protected ISpincastConfig getSpincastConfig()
-
getSpincastPebbleTemplatingEngineConfig
protected ISpincastPebbleTemplatingEngineConfig getSpincastPebbleTemplatingEngineConfig()
-
getSpincastPebbleExtension
protected ISpincastPebbleExtension getSpincastPebbleExtension()
-
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
protected com.mitchellbosecke.pebble.loader.Loader<String> getClasspathTemplateLoader()
-
getFileSystemTemplateLoader
protected com.mitchellbosecke.pebble.loader.Loader<String> getFileSystemTemplateLoader()
-
evaluate
public String evaluate(String content,
Map<String,Object> params)
Description copied from interface: ITemplatingEngine
Evaluates the content, using the given parameters.
Uses the default Locale.
- Specified by:
evaluate in interface ITemplatingEngine
-
evaluate
public String evaluate(String content,
Map<String,Object> params,
Locale locale)
Description copied from interface: ITemplatingEngine
Evaluates the content, using the given parameters.
Uses the specified Locale.
- Specified by:
evaluate in interface ITemplatingEngine
-
evaluate
public String evaluate(String content,
IJsonObject jsonObject)
Description copied from interface: ITemplatingEngine
Evaluates the content, using the given parameters.
specified as a IJsonObject.
Uses the default Locale.
- Specified by:
evaluate in interface ITemplatingEngine
-
evaluate
public String evaluate(String content,
IJsonObject jsonObject,
Locale locale)
Description copied from interface: ITemplatingEngine
Evaluates the content, using the given parameters.
specified as a IJsonObject.
Uses the specified Locale.
- Specified by:
evaluate in interface ITemplatingEngine
-
fromTemplate
public String fromTemplate(String templatePath,
Map<String,Object> params)
Description copied from interface: ITemplatingEngine
Evaluates a template using the given parameters.
Uses the default Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
- Parameters:
templatePath - must be a classpath's relative path.
-
fromTemplate
public String fromTemplate(String templatePath,
IJsonObject jsonObject)
Description copied from interface: ITemplatingEngine
Evaluates a template using the parameters specified
as a IJsonObject.
Uses the default Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
- Parameters:
templatePath - must be a classpath's relative path.
-
fromTemplate
public String fromTemplate(String templatePath,
IJsonObject jsonObject,
Locale locale)
Description copied from interface: ITemplatingEngine
Evaluates a template using the parameters specified
as a IJsonObject.
Uses the specified Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
- Parameters:
templatePath - must be a classpath's relative path.
-
fromTemplate
public String fromTemplate(String templatePath,
Map<String,Object> params,
Locale locale)
Description copied from interface: ITemplatingEngine
Evaluates a template using the given parameters.
Uses the specified Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
- Parameters:
templatePath - must be a classpath's relative path.
-
fromTemplate
public String fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params)
Description copied from interface: ITemplatingEngine
Evaluates a template using the given parameters.
Uses the default Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
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: ITemplatingEngine
Evaluates a template using the given parameters.
Uses the specified Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
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,
IJsonObject jsonObject)
Description copied from interface: ITemplatingEngine
Evaluates a template using the parameters specified
as a IJsonObject.
Uses the default Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
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,
IJsonObject jsonObject,
Locale locale)
Description copied from interface: ITemplatingEngine
Evaluates a template using the parameters specified
as a IJsonObject.
Uses the specified Locale.
- Specified by:
fromTemplate in interface ITemplatingEngine
isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.
-
convertJsonObjectToMap
protected Map<String,Object> convertJsonObjectToMap(IJsonObject jsonObject)
Converts a IJsonObject to a Map<String, Object>, but only
the first level, only so it can be pass to the Pebble templating
engine which requires a Map<String, Object>.
-
parse
protected String parse(String htmlOrPath,
Map<String,Object> params,
boolean isTemplate,
boolean isClasspathPath,
Locale locale)
-
createPlaceholder
public String createPlaceholder(String variable)
Description copied from interface: ITemplatingEngine
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 ITemplatingEngine
Copyright © 2016. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy