Class Handlebars
- All Implemented Interfaces:
HelperRegistry
Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.
Getting Started:
Handlebars handlebars = new Handlebars(); Template template = handlebars.compileInline("Hello {{this}}!"); System.out.println(template.apply("Handlebars.java"));
Loading templates
Templates are loaded using the ```TemplateLoader``` class. Handlebars.java provides three implementations of a ```TemplateLoader```:- ClassPathTemplateLoader (default)
- FileTemplateLoader
- SpringTemplateLoader (available at the handlebars-springmvc module)
This example load mytemplate.hbs
from the root of the classpath:
Handlebars handlebars = new Handlebars(); Template template = handlebars.compileInline(URI.create("mytemplate")); System.out.println(template.apply("Handlebars.java"));
You can specify a different ```TemplateLoader``` by:
TemplateLoader loader = ...; Handlebars handlebars = new Handlebars(loader);
- Since:
- 0.1.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.com.github.jknack.handlebars package is deprecated and marked for removal in subsequent releases which will involve removal of the handlebars dependency in AEM.static class
Deprecated.com.github.jknack.handlebars package is deprecated and marked for removal in subsequent releases which will involve removal of the handlebars dependency in AEM. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.The default end delimiter.static final String
Deprecated.The default start delimiter.Fields inherited from interface com.github.jknack.handlebars.HelperRegistry
HELPER_MISSING
-
Constructor Summary
ConstructorDescriptionDeprecated.Creates a newHandlebars
with aClassPathTemplateLoader
and no cache.Handlebars
(TemplateLoader loader) Deprecated.Creates a newHandlebars
with no cache. -
Method Summary
Modifier and TypeMethodDescriptioncompile
(TemplateSource source) Deprecated.Compile a handlebars template.compile
(TemplateSource source, String startDelimiter, String endDelimiter) Deprecated.Compile a handlebars template.Deprecated.Compile the resource located at the given uri.Deprecated.Compile the resource located at the given uri.compileInline
(String input) Deprecated.Compile a handlebars template.compileInline
(String input, String startDelimiter, String endDelimiter) Deprecated.Compile a handlebars template.static void
Deprecated.Log the given message as debug and format the message within the args.static void
Deprecated.Log the given message as debug and format the message within the args.Deprecated.Find a decorator by name.boolean
Deprecated.If true, templates will be deleted once applied.deletePartialAfterMerge
(boolean deletePartialAfterMerge) Deprecated.If true, templates will be deleted once applied.endDelimiter
(String endDelimiter) Deprecated.Set the end delimiter.static void
Deprecated.Log the given message as error and format the message within the args.static void
Deprecated.Log the given message as error and format the message within the args.getCache()
Deprecated.The template cache.Deprecated.Deprecated.The End Delimiter.Deprecated.The escaping strategy.Deprecated.Deprecated.The resource locator.Deprecated.Return a parser factory.Deprecated.The Start Delimiter.Deprecated.handlebarsJsFile
(String location) Deprecated.Set the handlebars.js location used it to compile/precompile template to JavaScript.<C> Helper
<C> Deprecated.Find a helper by name.helpers()
Deprecated.List all the helpers from registry.boolean
Deprecated.If true, templates will be able to call him self directly or indirectly.infiniteLoops
(boolean infiniteLoops) Deprecated.If true, templates will be able to call him self directly or indirectly.static void
Deprecated.Log the given message and format the message within the args.static void
Deprecated.Log the given message and format the message within the args.boolean
Deprecated.parentScopeResolution
(boolean parentScopeResolution) Deprecated.Given:precompile
(String path) Deprecated.Precompile a template to JavaScript.precompileInline
(String template) Deprecated.Precompile a template to JavaScript.boolean
Deprecated.If true, partial blocks will implicitly be evaluated before the partials will actually be executed.preEvaluatePartialBlocks
(boolean preEvaluatePartialBlocks) Deprecated.If true, partial blocks will implicitly be evaluated before the partials will actually be executed.boolean
Deprecated.If true, unnecessary spaces and new lines will be removed from output.prettyPrint
(boolean prettyPrint) Deprecated.If true, unnecessary spaces and new lines will be removed from output.registerDecorator
(String name, Decorator decorator) Deprecated.Register a decorator and make it accessible viaHelperRegistry.decorator(String)
.<H> Handlebars
registerHelper
(String name, Helper<H> helper) Deprecated.Register a helper in the helper registry.<H> Handlebars
registerHelperMissing
(Helper<H> helper) Deprecated.Register a missing helper in the helper registry.registerHelpers
(File input) Deprecated.Register helpers from a JavaScript source.registerHelpers
(Class<?> helperSource) Deprecated.Register all the helper methods for the given helper source.registerHelpers
(Object helperSource) Deprecated.Register all the helper methods for the given helper source.registerHelpers
(String filename, InputStream source) Deprecated.Register helpers from a JavaScript source.registerHelpers
(String filename, Reader source) Deprecated.Register helpers from a JavaScript source.registerHelpers
(String filename, String source) Deprecated.Register helpers from a JavaScript source.registerHelpers
(URI location) Deprecated.Register helpers from a JavaScript source.setCharset
(Charset charset) Deprecated.Set the charset to use.void
setDeletePartialAfterMerge
(boolean deletePartialAfterMerge) Deprecated.If true, templates will be deleted once applied.void
setEndDelimiter
(String endDelimiter) Deprecated.Set the end delimiter.void
setInfiniteLoops
(boolean infiniteLoops) Deprecated.If true, templates will be able to call him self directly or indirectly.void
setParentScopeResolution
(boolean parentScopeResolution) Deprecated.Given:void
setPreEvaluatePartialBlocks
(boolean preEvaluatePartialBlocks) Deprecated.If true, partial blocks will implicitly be evaluated before the partials will actually be executed.void
setPrettyPrint
(boolean prettyPrint) Deprecated.If true, unnecessary spaces and new lines will be removed from output.void
setStartDelimiter
(String startDelimiter) Deprecated.Set the start delimiter.void
setStringParams
(boolean stringParams) Deprecated.If true, missing helper parameters will be resolve to their names.startDelimiter
(String startDelimiter) Deprecated.Set the start delimiter.boolean
Deprecated.If true, missing helper parameters will be resolve to their names.stringParams
(boolean stringParams) Deprecated.If true, missing helper parameters will be resolve to their names.static void
Deprecated.Log the given message as warn and format the message within the args.static void
Deprecated.Log the given message as warn and format the message within the args.with
(TemplateCache cache) Deprecated.Set a newTemplateCache
.with
(EscapingStrategy escapingStrategy) Deprecated.Set a newEscapingStrategy
.with
(EscapingStrategy... chain) Deprecated.Set a newEscapingStrategy
.Deprecated.Add a new variable formatter.with
(HelperRegistry registry) Deprecated.Set the helper registry.with
(TemplateLoader... loader) Deprecated.Set one or moreTemplateLoader
.with
(ParserFactory parserFactory) Deprecated.Set a newParserFactory
.
-
Field Details
-
DELIM_START
Deprecated.The default start delimiter.- See Also:
-
DELIM_END
Deprecated.The default end delimiter.- See Also:
-
-
Constructor Details
-
Handlebars
Deprecated.Creates a newHandlebars
with no cache.- Parameters:
loader
- The template loader. Required.
-
Handlebars
public Handlebars()Deprecated.Creates a newHandlebars
with aClassPathTemplateLoader
and no cache.
-
-
Method Details
-
precompile
Deprecated.Precompile a template to JavaScript.- Parameters:
path
- Template path.- Returns:
- JavaScript.
-
precompileInline
Deprecated.Precompile a template to JavaScript.- Parameters:
template
- Template.- Returns:
- JavaScript.
-
compile
Deprecated.Compile the resource located at the given uri. The implementation uses a cache for previously compiled Templates. By default, if the resource has been compiled previously, and no changes have occurred since in the resource, compilation will be skipped and the previously created Template will be returned. You can set an alternate cache implementation usingwith
.- Parameters:
location
- The resource's location. Required.- Returns:
- A compiled template.
- Throws:
IOException
- If the resource cannot be loaded.
-
compile
public Template compile(String location, String startDelimiter, String endDelimiter) throws IOException Deprecated.Compile the resource located at the given uri. The implementation uses a cache for previously compiled Templates. By default, if the resource has been compiled previously, and no changes have occurred since in the resource, compilation will be skipped and the previously created Template will be returned. You can set an alternate cache implementation usingwith
.- Parameters:
location
- The resource's location. Required.startDelimiter
- The start delimiter. Required.endDelimiter
- The end delimiter. Required.- Returns:
- A compiled template.
- Throws:
IOException
- If the resource cannot be loaded.
-
compileInline
Deprecated.Compile a handlebars template. The implementation uses a cache for previously compiled Templates. By default, if same input string has been compiled previously, compilation will be skipped and the previously created Template will be returned. You can set an alternate cache implementation usingwith
.- Parameters:
input
- The handlebars input. Required.- Returns:
- A compiled template.
- Throws:
IOException
- If the resource cannot be loaded.
-
compileInline
public Template compileInline(String input, String startDelimiter, String endDelimiter) throws IOException Deprecated.Compile a handlebars template. The implementation uses a cache for previously compiled Templates. By default, if same input string has been compiled previously, compilation will be skipped and the previously created Template will be returned. You can set an alternate cache implementation usingwith
.- Parameters:
input
- The input text. Required.startDelimiter
- The start delimiter. Required.endDelimiter
- The end delimiter. Required.- Returns:
- A compiled template.
- Throws:
IOException
- If the resource cannot be loaded.
-
compile
Deprecated.Compile a handlebars template. The implementation uses a cache for previously compiled Templates. By default, if the resource has been compiled previously, and no changes have occurred since in the resource, compilation will be skipped and the previously created Template will be returned. You can set an alternate cache implementation usingwith
.- Parameters:
source
- The template source. Required.- Returns:
- A handlebars template.
- Throws:
IOException
- If the resource cannot be loaded.
-
compile
public Template compile(TemplateSource source, String startDelimiter, String endDelimiter) throws IOException Deprecated.Compile a handlebars template. The implementation uses a cache for previously compiled Templates. By default, if the resource has been compiled previously, and no changes have occurred since in the resource, compilation will be skipped and the previously created Template will be returned. You can set an alternate cache implementation usingwith
.- Parameters:
source
- The template source. Required.startDelimiter
- The start delimiter. Required.endDelimiter
- The end delimiter. Required.- Returns:
- A handlebars template.
- Throws:
IOException
- If the resource cannot be loaded.
-
helper
Deprecated.Find a helper by name.- Specified by:
helper
in interfaceHelperRegistry
- Type Parameters:
C
- The helper runtime type.- Parameters:
name
- The helper's name. Required.- Returns:
- A helper or null if it's not found.
-
registerHelper
Deprecated.Register a helper in the helper registry.- Specified by:
registerHelper
in interfaceHelperRegistry
- Type Parameters:
H
- The helper runtime type.- Parameters:
name
- The helper's name. Required.helper
- The helper object. Required.- Returns:
- This handlebars.
-
registerHelperMissing
Deprecated.Register a missing helper in the helper registry.- Specified by:
registerHelperMissing
in interfaceHelperRegistry
- Type Parameters:
H
- The helper runtime type.- Parameters:
helper
- The helper object. Required.- Returns:
- This handlebars.
-
registerHelpers
Deprecated.Register all the helper methods for the given helper source.
A helper method looks like:
public static? CharSequence methodName(context?, parameter*, options?) { }
Where:- A method can/can't be static
- The method's name became the helper's name
- Context, parameters and options are all optional
- If context and options are present they must be the first and last method arguments.
- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
helperSource
- The helper source. Required.- Returns:
- This handlebars object.
-
registerHelpers
Deprecated.Register all the helper methods for the given helper source.
A helper method looks like:
public static? CharSequence methodName(context?, parameter*, options?) { }
Where:- A method can/can't be static
- The method's name became the helper's name
- Context, parameters and options are all optional
- If context and options are present they must be the first and last method arguments.
Enums are supported too
- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
helperSource
- The helper source. Enums are supported. Required.- Returns:
- This handlebars object.
-
registerHelpers
Deprecated.Register helpers from a JavaScript source.
A JavaScript source file looks like:
Handlebars.registerHelper('hey', function (context) { return 'Hi ' + context.name; }); ... Handlebars.registerHelper('hey', function (context, options) { return 'Hi ' + context.name + options.hash['x']; }); ... Handlebars.registerHelper('hey', function (context, p1, p2, options) { return 'Hi ' + context.name + p1 + p2 + options.hash['x']; }); ...
To keep your helpers reusable between server and client avoid DOM manipulation.- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
location
- A classpath location. Required.- Returns:
- This handlebars object.
- Throws:
Exception
- If the JavaScript helpers can't be registered.
-
registerHelpers
Deprecated.Register helpers from a JavaScript source.
A JavaScript source file looks like:
Handlebars.registerHelper('hey', function (context) { return 'Hi ' + context.name; }); ... Handlebars.registerHelper('hey', function (context, options) { return 'Hi ' + context.name + options.hash['x']; }); ... Handlebars.registerHelper('hey', function (context, p1, p2, options) { return 'Hi ' + context.name + p1 + p2 + options.hash['x']; }); ...
To keep your helpers reusable between server and client avoid DOM manipulation.- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
input
- A JavaScript file name. Required.- Returns:
- This handlebars object.
- Throws:
Exception
- If the JavaScript helpers can't be registered.
-
registerHelpers
Deprecated.Register helpers from a JavaScript source.
A JavaScript source file looks like:
Handlebars.registerHelper('hey', function (context) { return 'Hi ' + context.name; }); ... Handlebars.registerHelper('hey', function (context, options) { return 'Hi ' + context.name + options.hash['x']; }); ... Handlebars.registerHelper('hey', function (context, p1, p2, options) { return 'Hi ' + context.name + p1 + p2 + options.hash['x']; }); ...
To keep your helpers reusable between server and client avoid DOM manipulation.- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
filename
- The file name (just for debugging purpose). Required.source
- The JavaScript source. Required.- Returns:
- This handlebars object.
- Throws:
Exception
- If the JavaScript helpers can't be registered.
-
registerHelpers
Deprecated.Register helpers from a JavaScript source.
A JavaScript source file looks like:
Handlebars.registerHelper('hey', function (context) { return 'Hi ' + context.name; }); ... Handlebars.registerHelper('hey', function (context, options) { return 'Hi ' + context.name + options.hash['x']; }); ... Handlebars.registerHelper('hey', function (context, p1, p2, options) { return 'Hi ' + context.name + p1 + p2 + options.hash['x']; }); ...
To keep your helpers reusable between server and client avoid DOM manipulation.- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
filename
- The file name (just for debugging purpose). Required.source
- The JavaScript source. Required.- Returns:
- This handlebars object.
- Throws:
Exception
- If the JavaScript helpers can't be registered.
-
registerHelpers
Deprecated.Register helpers from a JavaScript source.
A JavaScript source file looks like:
Handlebars.registerHelper('hey', function (context) { return 'Hi ' + context.name; }); ... Handlebars.registerHelper('hey', function (context, options) { return 'Hi ' + context.name + options.hash['x']; }); ... Handlebars.registerHelper('hey', function (context, p1, p2, options) { return 'Hi ' + context.name + p1 + p2 + options.hash['x']; }); ...
To keep your helpers reusable between server and client avoid DOM manipulation.- Specified by:
registerHelpers
in interfaceHelperRegistry
- Parameters:
filename
- The file name (just for debugging purpose). Required.source
- The JavaScript source. Required.- Returns:
- This handlebars object.
- Throws:
IOException
- If the JavaScript helpers can't be registered.
-
helpers
Deprecated.Description copied from interface:HelperRegistry
List all the helpers from registry.- Specified by:
helpers
in interfaceHelperRegistry
- Returns:
- Available helpers in the registry.
-
getLoader
Deprecated.The resource locator.- Returns:
- The resource locator.
-
getCache
Deprecated.The template cache.- Returns:
- The template cache.
-
getEscapingStrategy
Deprecated.The escaping strategy.- Returns:
- The escaping strategy.
-
stringParams
public boolean stringParams()Deprecated.If true, missing helper parameters will be resolve to their names.- Returns:
- If true, missing helper parameters will be resolve to their names.
-
prettyPrint
public boolean prettyPrint()Deprecated.If true, unnecessary spaces and new lines will be removed from output. Default is: false.- Returns:
- If true, unnecessary spaces and new lines will be removed from output. Default is: false.
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) Deprecated.If true, unnecessary spaces and new lines will be removed from output. Default is: false.- Parameters:
prettyPrint
- If true, unnecessary spaces and new lines will be removed from output. Default is: false.
-
prettyPrint
Deprecated.If true, unnecessary spaces and new lines will be removed from output. Default is: false.- Parameters:
prettyPrint
- If true, unnecessary spaces and new lines will be removed from output. Default is: false.- Returns:
- This handlebars object.
-
setStringParams
public void setStringParams(boolean stringParams) Deprecated.If true, missing helper parameters will be resolve to their names.- Parameters:
stringParams
- If true, missing helper parameters will be resolve to their names.
-
stringParams
Deprecated.If true, missing helper parameters will be resolve to their names.- Parameters:
stringParams
- If true, missing helper parameters will be resolve to their names.- Returns:
- The handlebars object.
-
infiniteLoops
public boolean infiniteLoops()Deprecated.If true, templates will be able to call him self directly or indirectly. Use with caution. Default is: false.- Returns:
- If true, templates will be able to call him self directly or indirectly. Use with caution. Default is: false.
-
setInfiniteLoops
public void setInfiniteLoops(boolean infiniteLoops) Deprecated.If true, templates will be able to call him self directly or indirectly. Use with caution. Default is: false.- Parameters:
infiniteLoops
- If true, templates will be able to call him self directly or indirectly.
-
infiniteLoops
Deprecated.If true, templates will be able to call him self directly or indirectly. Use with caution. Default is: false.- Parameters:
infiniteLoops
- If true, templates will be able to call him self directly or indirectly.- Returns:
- The handlebars object.
-
deletePartialAfterMerge
public boolean deletePartialAfterMerge()Deprecated.If true, templates will be deleted once applied. Useful, in some advanced template inheritance use cases. Used by{{#block}} helper
. Default is: false. At any time you can override the default setup with:{{#block "footer" delete-after-merge=true}}
- Returns:
- True for clearing up templates once they got applied. Used by
{{#block}} helper
.
-
deletePartialAfterMerge
Deprecated.If true, templates will be deleted once applied. Useful, in some advanced template inheritance use cases. Used by{{#block}} helper
. Default is: false. At any time you can override the default setup with:{{#block "footer" delete-after-merge=true}}
- Parameters:
deletePartialAfterMerge
- True for clearing up templates once they got applied. Used by{{#block}} helper
.- Returns:
- This handlebars object.
-
setDeletePartialAfterMerge
public void setDeletePartialAfterMerge(boolean deletePartialAfterMerge) Deprecated.If true, templates will be deleted once applied. Useful, in some advanced template inheritance use cases. Used by{{#block}} helper
. Default is: false. At any time you can override the default setup with:{{#block "footer" delete-after-merge=true}}
- Parameters:
deletePartialAfterMerge
- True for clearing up templates once they got applied. Used by{{#block}} helper
.
-
setEndDelimiter
Deprecated.Set the end delimiter.- Parameters:
endDelimiter
- The end delimiter. Required.
-
endDelimiter
Deprecated.Set the end delimiter.- Parameters:
endDelimiter
- The end delimiter. Required.- Returns:
- This handlebars object.
-
getEndDelimiter
Deprecated.The End Delimiter.- Returns:
- The End Delimiter.
-
setStartDelimiter
Deprecated.Set the start delimiter.- Parameters:
startDelimiter
- The start delimiter. Required.
-
startDelimiter
Deprecated.Set the start delimiter.- Parameters:
startDelimiter
- The start delimiter. Required.- Returns:
- This handlebars object.
-
getStartDelimiter
Deprecated.The Start Delimiter.- Returns:
- The Start Delimiter.
-
with
Deprecated.Set one or moreTemplateLoader
. In the case of two or moreTemplateLoader
, aCompositeTemplateLoader
will be created. Default is:ClassPathTemplateLoader
.- Parameters:
loader
- The template loader. Required.- Returns:
- This handlebars object.
- See Also:
-
with
Deprecated.Set a newParserFactory
.- Parameters:
parserFactory
- A parser factory. Required.- Returns:
- This handlebars object.
-
with
Deprecated.Set a newTemplateCache
.- Parameters:
cache
- The template cache. Required.- Returns:
- This handlebars object.
-
with
Deprecated.Set the helper registry. This operation will override will remove any previously registered helper.- Parameters:
registry
- The helper registry. Required.- Returns:
- This handlebars object.
-
with
Deprecated.Set a newEscapingStrategy
.- Parameters:
escapingStrategy
- The escaping strategy. Required.- Returns:
- This handlebars object.
-
with
Deprecated.Set a newEscapingStrategy
.- Parameters:
chain
- The escaping strategy. Required.- Returns:
- This handlebars object.
-
getFormatter
Deprecated.- Returns:
- A formatter chain.
-
with
Deprecated.Add a new variable formatter.Handlebars hbs = new Handlebars(); hbs.with(new Formatter() { public Object format(Object value, Chain next) { if (value instanceof Date) { return ((Date) value).getTime(); } return next.format(value); } });
- Parameters:
formatter
- A formatter.- Returns:
- This handlebars object.
-
handlebarsJsFile
Deprecated.Set the handlebars.js location used it to compile/precompile template to JavaScript.Using handlebars.js 4.x:
Handlebars handlebars = new Handlebars() .handlebarsJsFile("handlebars-v4.0.4.js");
Using handlebars.js 1.x:
Handlebars handlebars = new Handlebars() .handlebarsJsFile("handlebars-v1.3.0.js");
Default handlebars.js ishandlebars-v4.0.4.js
.- Parameters:
location
- A classpath location of the handlebar.js file.- Returns:
- This instance of Handlebars.
-
handlebarsJsFile
Deprecated.- Returns:
- Classpath location of the handlebars.js file. Default is:
handlebars-v4.0.4.js
-
parentScopeResolution
public boolean parentScopeResolution()Deprecated.- Returns:
- True, if we want to extend lookup to parent scope, like Mustache Spec. Or false, if lookup is restricted to current scope, like handlebars.js.
-
setParentScopeResolution
public void setParentScopeResolution(boolean parentScopeResolution) Deprecated.Given:{ "value": "Brett", "child": { "bestQB" : "Favre" } }
Handlebars.java will output:Hello Favre Brett
while handlebars.js:Hello Favre
. Why? Handlebars.java is a 100% Mustache implementation while handlebars.js isn't. This option forces Handlebars.java mimics handlebars.js behavior:Handlebars hbs = new Handlebars() .parentScopeResolution(true);
Outputs:Hello Favre
.- Parameters:
parentScopeResolution
- False, if we want to restrict lookup to current scope (like in handlebars.js). Default istrue
-
parentScopeResolution
Deprecated.Given:{ "value": "Brett", "child": { "bestQB" : "Favre" } }
Handlebars.java will output:Hello Favre Brett
while handlebars.js:Hello Favre
. Why? Handlebars.java is a 100% Mustache implementation while handlebars.js isn't. This option forces Handlebars.java mimics handlebars.js behavior:Handlebars hbs = new Handlebars() .parentScopeResolution(true);
Outputs:Hello Favre
.- Parameters:
parentScopeResolution
- False, if we want to restrict lookup to current scope (like in handlebars.js). Default istrue
- Returns:
- This handlebars.
-
preEvaluatePartialBlocks
public boolean preEvaluatePartialBlocks()Deprecated.If true, partial blocks will implicitly be evaluated before the partials will actually be executed. If false, you need to explicitly evaluate and render partial blocks with
Attention: If this is set to true, Handlebars works *much* slower! while rendering partial blocks. Default is: true for compatibility reasons.{{> @partial-block}}
- Returns:
- If true partial blocks will be evaluated before the partial will be rendered to allow inline block side effects. If false, you will have to evaluate and render partial blocks explitly (this option is *much* faster).
-
setPreEvaluatePartialBlocks
public void setPreEvaluatePartialBlocks(boolean preEvaluatePartialBlocks) Deprecated.If true, partial blocks will implicitly be evaluated before the partials will actually be executed. If false, you need to explicitly evaluate and render partial blocks with
Attention: If this is set to true, Handlebars works *much* slower! while rendering partial blocks. Default is: true for compatibility reasons.{{> @partial-block}}
- Parameters:
preEvaluatePartialBlocks
- If true partial blocks will be evaluated before the partial will be rendered to allow inline block side effects. If false, you will have to evaluate and render partial blocks explitly (this option is *much* faster).
-
preEvaluatePartialBlocks
Deprecated.If true, partial blocks will implicitly be evaluated before the partials will actually be executed. If false, you need to explicitly evaluate and render partial blocks with
Attention: If this is set to true, Handlebars works *much* slower! while rendering partial blocks. Default is: true for compatibility reasons.{{> @partial-block}}
- Parameters:
preEvaluatePartialBlocks
- If true partial blocks will be evaluated before the partial will be rendered to allow inline block side effects. If false, you will have to evaluate and render partial blocks explitly (this option is *much* faster).- Returns:
- The Handlebars object
-
getParserFactory
Deprecated.Return a parser factory.- Returns:
- A parser factory.
-
log
Deprecated.Log the given message and format the message within the args.- Parameters:
message
- The log's message.args
- The optional args.- See Also:
-
log
Deprecated.Log the given message and format the message within the args.- Parameters:
message
- The log's message.- See Also:
-
warn
Deprecated.Log the given message as warn and format the message within the args.- Parameters:
message
- The log's message.args
- The optional args.- See Also:
-
warn
Deprecated.Log the given message as warn and format the message within the args.- Parameters:
message
- The log's message.- See Also:
-
debug
Deprecated.Log the given message as debug and format the message within the args.- Parameters:
message
- The log's message.args
- The optional args.- See Also:
-
debug
Deprecated.Log the given message as debug and format the message within the args.- Parameters:
message
- The log's message.- See Also:
-
error
Deprecated.Log the given message as error and format the message within the args.- Parameters:
message
- The log's message.args
- The optional args.- See Also:
-
error
Deprecated.Log the given message as error and format the message within the args.- Parameters:
message
- The log's message.- See Also:
-
decorator
Deprecated.Description copied from interface:HelperRegistry
Find a decorator by name.- Specified by:
decorator
in interfaceHelperRegistry
- Parameters:
name
- A decorator's name.- Returns:
- A decorator or
null
.
-
registerDecorator
Deprecated.Description copied from interface:HelperRegistry
Register a decorator and make it accessible viaHelperRegistry.decorator(String)
.- Specified by:
registerDecorator
in interfaceHelperRegistry
- Parameters:
name
- A decorator's name. Required.decorator
- A decorator. Required.- Returns:
- This registry.
-
setCharset
Deprecated.Description copied from interface:HelperRegistry
Set the charset to use.- Specified by:
setCharset
in interfaceHelperRegistry
- Parameters:
charset
- Charset.- Returns:
- This registry.
-
getCharset
Deprecated.- Returns:
- Charset.
-