public class Template extends Object
parse(...) to get a hold of a reference.
Also see: https://github.com/Shopify/liquid| Modifier and Type | Method and Description |
|---|---|
org.antlr.v4.runtime.tree.ParseTree |
getParseTree()
Returns the root of the parse tree of the parsed input.
|
static Template |
parse(File file)
Returns a new Template instance from a given input file.
|
static Template |
parse(File file,
Flavor flavor)
Deprecated.
|
static Template |
parse(File file,
ParseSettings settings) |
static Template |
parse(File file,
ParseSettings parseSettings,
RenderSettings renderSettings) |
static Template |
parse(String input)
Returns a new Template instance from a given input string.
|
static Template |
parse(String input,
Flavor flavor)
Deprecated.
|
static Template |
parse(String input,
ParseSettings settings) |
String |
render() |
String |
render(boolean convertValueToMap,
String key,
Object value,
Object... keyValues) |
String |
render(Map<String,Object> variables)
Renders the template.
|
String |
render(Map<String,Object> variables,
ExecutorService executorService,
boolean shutdown) |
String |
render(String jsonMap)
Renders the template.
|
String |
render(String key,
Object value,
Object... keyValues)
Renders the template.
|
String |
renderUnguarded(Map<String,Object> variables)
Renders the template without guards provided by protection settings.
|
String |
toStringAST()
Deprecated.
|
String |
toStringTree()
Returns a string representation of the parse tree of the parsed
input source.
|
Template |
with(Filter filter) |
Template |
with(Tag tag) |
Template |
withProtectionSettings(ProtectionSettings protectionSettings) |
Template |
withRenderSettings(RenderSettings renderSettings) |
public org.antlr.v4.runtime.tree.ParseTree getParseTree()
public static Template parse(String input)
input - the input string holding the Liquid source.public static Template parse(File file) throws IOException
file - the input file holding the Liquid source.IOExceptionpublic static Template parse(File file, ParseSettings settings) throws IOException
IOExceptionpublic static Template parse(String input, ParseSettings settings)
public static Template parse(File file, ParseSettings parseSettings, RenderSettings renderSettings) throws IOException
IOException@Deprecated public static Template parse(File file, Flavor flavor) throws IOException
IOException@Deprecated public static Template parse(String input, Flavor flavor) throws IOException
IOExceptionpublic Template withProtectionSettings(ProtectionSettings protectionSettings)
public Template withRenderSettings(RenderSettings renderSettings)
public String render(String jsonMap)
jsonMap - a JSON-map denoting the (possibly nested)
variables that can be used in this Template.public String render()
public String render(String key, Object value, Object... keyValues)
key - a keyvalue - the value belonging to the keykeyValues - an array denoting key-value pairs where the
uneven numbers (even indexes) should be Strings.
If the length of this array is uneven, the last
key (without the value) gets `null` attached to
it. Note that a call to this method with a single
String as parameter, will be handled by
`render(String jsonMap)` instead.public String render(boolean convertValueToMap, String key, Object value, Object... keyValues)
public String render(Map<String,Object> variables)
variables - a Map denoting the (possibly nested)
variables that can be used in this
Template.public String render(Map<String,Object> variables, ExecutorService executorService, boolean shutdown)
public String renderUnguarded(Map<String,Object> variables)
variables - a Map denoting the (possibly nested)
variables that can be used in this
Template.@Deprecated public String toStringAST()
public String toStringTree()
Copyright © 2012–2019. All rights reserved.