Package com.github.jknack.handlebars
Interface Template
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.
A compiled template created by
Handlebars.compileInline(String)
.- Since:
- 0.1.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Merge the template tree using the given context.void
Deprecated.Merge the template tree using the given context.Deprecated.Merge the template tree using the given context.void
Deprecated.Merge the template tree using the given context.<T> TypeSafeTemplate
<T> as()
Deprecated.Creates a newTypeSafeTemplate
.<T,
S extends TypeSafeTemplate<T>>
SDeprecated.Creates a newTypeSafeTemplate
.Deprecated.Collect all the tag names under the given tagType.Deprecated.Collects all the parameters which are also variables.filename()
Deprecated.int[]
position()
Deprecated.text()
Deprecated.Provide the raw text.Deprecated.Convert this template to JavaScript template (a.k.a precompiled template).
-
Field Details
-
EMPTY
Deprecated.An empty template implementation.
-
-
Method Details
-
apply
Deprecated.Merge the template tree using the given context.- Parameters:
context
- The context object. May be null.writer
- The writer object. Required.- Throws:
IOException
- If a resource cannot be loaded.
-
apply
Deprecated.Merge the template tree using the given context.- Parameters:
context
- The context object. May be null.- Returns:
- The resulting template.
- Throws:
IOException
- If a resource cannot be loaded.
-
apply
Deprecated.Merge the template tree using the given context.- Parameters:
context
- The context object. Required.writer
- The writer object. Required.- Throws:
IOException
- If a resource cannot be loaded.
-
apply
Deprecated.Merge the template tree using the given context.- Parameters:
context
- The context object. Required.- Returns:
- The resulting template.
- Throws:
IOException
- If a resource cannot be loaded.
-
text
String text()Deprecated.Provide the raw text.- Returns:
- The raw text.
-
toJavaScript
String toJavaScript()Deprecated.Convert this template to JavaScript template (a.k.a precompiled template). Compilation is done by handlebars.js and a JS Engine (usually Rhino).- Returns:
- A pre-compiled JavaScript version of this template.
-
as
Deprecated.Creates a newTypeSafeTemplate
.- Type Parameters:
T
- The root type.S
- The template type.- Parameters:
type
- The template type. Required.- Returns:
- A new
TypeSafeTemplate
.
-
as
Deprecated.Creates a newTypeSafeTemplate
.- Type Parameters:
T
- The root type.- Returns:
- A new
TypeSafeTemplate
.
-
collect
Deprecated.Collect all the tag names under the given tagType.Usage:
{{hello}} {{var 1}} {{{tripleVar}}}
collect(TagType.VAR)
returns[hello, var]
collect(TagType.TRIPLE_VAR)
returns[tripleVar]
collect(TagType.VAR, TagType.TRIPLE_VAR)
returns[hello, var, tripleVar]
- Parameters:
tagType
- The tag type. Required.- Returns:
- A list with tag names.
-
collectReferenceParameters
Deprecated.Collects all the parameters which are also variables.Usage:
{{#if v1}}{{/if}} {{#each v2 "test"}}{{/each}}
collectReferenceParameters()
returns[v1, v2]
- Returns:
- A list with reference parameter names.
-
filename
String filename()Deprecated.- Returns:
- The template file's name.
-
position
int[] position()Deprecated.- Returns:
- The line and column where the template was found.
-