public class VelocimacroManager extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
addVM(String vmName,
Node macroBody,
List<Macro.MacroArg> macroArgs,
Template definingTemplate,
boolean canReplaceGlobalMacro)
Adds a VM definition to the cache.
|
VelocimacroProxy |
get(String vmName,
Template renderingTemplate,
Template template)
Gets a VelocimacroProxy object by the name / source template duple.
|
String |
getLibraryName(String vmName,
Template template)
Return the library name for a given macro.
|
void |
setInlineReplacesGlobal(boolean is) |
void |
setNamespaceUsage(boolean namespaceOn)
public switch to let external user of manager to control namespace
usage indep of properties.
|
void |
setRegisterFromLib(boolean registerFromLib)
Should macros registered from Libraries be marked special?
|
void |
setTemplateLocalInlineVM(boolean inlineLocalMode)
Should macros from the same template be inlined?
|
public boolean addVM(String vmName, Node macroBody, List<Macro.MacroArg> macroArgs, Template definingTemplate, boolean canReplaceGlobalMacro)
vmName
- Name of the new VelociMacro.macroBody
- String representation of the macro body.macroArgs
- Array of macro arguments, containing the
#macro() arguments and default values. the 0th is the name.definingTemplate
- The template from which this macro has been loaded.canReplaceGlobalMacro
- whether this macro can replace a global macropublic VelocimacroProxy get(String vmName, Template renderingTemplate, Template template)
vmName
- Name of the VelocityMacro to look up.renderingTemplate
- Template we are currently rendering.template
- Source Template.public void setNamespaceUsage(boolean namespaceOn)
namespaceOn
- True if namespaces should be used.public void setRegisterFromLib(boolean registerFromLib)
registerFromLib
- True if macros from Libs should be marked.public void setTemplateLocalInlineVM(boolean inlineLocalMode)
inlineLocalMode
- True if macros should be inlined on the same template.public String getLibraryName(String vmName, Template template)
vmName
- Name of the Macro to look up.template
- Templatepublic void setInlineReplacesGlobal(boolean is)
is
- Copyright © 2000–2021 The Apache Software Foundation. All rights reserved.