public class VelocimacroManager
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
addVM(java.lang.String vmName,
Node macroBody,
java.lang.String[] argArray,
java.lang.String namespace,
boolean canReplaceGlobalMacro)
Adds a VM definition to the cache.
|
boolean |
dumpNamespace(java.lang.String namespace)
Removes the VMs and the namespace from the manager.
|
VelocimacroProxy |
get(java.lang.String vmName,
java.lang.String namespace)
Gets a VelocimacroProxy object by the name / source template duple.
|
VelocimacroProxy |
get(java.lang.String vmName,
java.lang.String namespace,
java.lang.String renderingTemplate)
Gets a VelocimacroProxy object by the name / source template duple.
|
java.lang.String |
getLibraryName(java.lang.String vmName,
java.lang.String namespace)
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(java.lang.String vmName,
Node macroBody,
java.lang.String[] argArray,
java.lang.String namespace,
boolean canReplaceGlobalMacro)
vmName - Name of the new VelociMacro.macroBody - String representation of the macro body.argArray - Array of macro parameters, first parameter is the macro name.namespace - The namespace/template from which this macro has been loaded.public VelocimacroProxy get(java.lang.String vmName, java.lang.String namespace)
vmName - Name of the VelocityMacro to look up.namespace - Namespace in which to look up the macro.public VelocimacroProxy get(java.lang.String vmName, java.lang.String namespace, java.lang.String renderingTemplate)
vmName - Name of the VelocityMacro to look up.namespace - Namespace in which to look up the macro.renderingTemplate - Name of the template we are currently rendering.public boolean dumpNamespace(java.lang.String namespace)
namespace - namespace to dumppublic 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 java.lang.String getLibraryName(java.lang.String vmName,
java.lang.String namespace)
vmName - Name of the Macro to look up.namespace - Namespace to look the macro up.public void setInlineReplacesGlobal(boolean is)