public class VelocimacroFactory extends Object
Constructor and Description |
---|
VelocimacroFactory(RuntimeServices rsvc)
C'tor for the VelociMacro factory.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addVelocimacro(String name,
Node macroBody,
List<Macro.MacroArg> macroArgs,
Template definingTemplate)
Adds a macro to the factory.
|
Directive |
getVelocimacro(String vmName,
Template renderingTemplate,
Template sourceTemplate)
actual factory: creates a Directive that will
behave correctly wrt getting the framework to
dig out the correct # of args
|
void |
initVelocimacro()
initialize the factory - setup all permissions
load all global libraries.
|
boolean |
isVelocimacro(String vm,
Template template)
Tells the world if a given directive string is a Velocimacro
|
public VelocimacroFactory(RuntimeServices rsvc)
rsvc
- Reference to a runtime services object.public void initVelocimacro()
public boolean addVelocimacro(String name, Node macroBody, List<Macro.MacroArg> macroArgs, Template definingTemplate)
name
- Name of the Macro to add.macroBody
- root node of the parsed macro ASTmacroArgs
- Array of macro arguments, containing the
#macro() arguments and default values. the 0th is the name.definingTemplate
- template containing the macro definitionpublic boolean isVelocimacro(String vm, Template template)
vm
- Name of the Macro.template
- Source template from which the macro should be loaded.public Directive getVelocimacro(String vmName, Template renderingTemplate, Template sourceTemplate)
vmName
- Name of the Macro.renderingTemplate
- destination templatesourceTemplate
- Source template from which the macro should be loaded.Copyright © 2000–2021 The Apache Software Foundation. All rights reserved.