org.apache.velocity.runtime
public class VelocimacroFactory extends Object
Version: $Id: VelocimacroFactory.java,v 1.17.4.1 2004/03/03 23:22:55 geirm Exp $
Nested Class Summary | |
---|---|
class | VelocimacroFactory.Twonk
small continer class to hold the duple
of a template and modification time.
|
Field Summary | |
---|---|
boolean | addNewAllowed
controls if new VMs can be added. |
boolean | autoReloadLibrary
determines if the libraries are auto-loaded
when they change |
boolean | blather
controls log output |
Map | libModMap
map of the library Template objects
used for reload determination |
Vector | macroLibVec
vector of the library names |
boolean | replaceAllowed
determines if replacement of global VMs are allowed
controlled by VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL |
RuntimeServices | rsvc
runtime services for this instance |
boolean | templateLocal
sets if template-local namespace in used |
VelocimacroManager | vmManager
VMManager : deal with namespace management
and actually keeps all the VM definitions |
Constructor Summary | |
---|---|
VelocimacroFactory(RuntimeServices rs)
CTOR : requires a runtime services from now
on |
Method Summary | |
---|---|
boolean | addVelocimacro(String name, String macroBody, String[] argArray, String sourceTemplate)
adds a macro to the factory. |
boolean | canAddVelocimacro(String name, String sourceTemplate)
determines if a given macro/namespace (name, source) combo is allowed
to be added
|
boolean | dumpVMNamespace(String namespace)
tells the vmManager to dump the specified namespace |
boolean | getAutoload()
get the switch for automatic reloading of
global library-based VMs |
boolean | getBlather()
get output message mode |
boolean | getTemplateLocalInline() |
Directive | getVelocimacro(String vmName, String 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, String sourceTemplate)
Tells the world if a given directive string is a Velocimacro |
void | logVMMessageInfo(String s)
localization of the logging logic |
void | logVMMessageWarn(String s)
localization of the logging logic |
boolean | setAddMacroPermission(boolean arg)
sets the permission to add new macros |
void | setAutoload(boolean b)
set the switch for automatic reloading of
global library-based VMs |
void | setBlather(boolean b)
set output message mode |
boolean | setReplacementPermission(boolean arg)
sets the permission for allowing addMacro() calls to
replace existing VM's |
void | setTemplateLocalInline(boolean b)
sets permission to have VMs local in scope to their declaring template
note that this is really taken care of in the VMManager class, but
we need it here for gating purposes in addVM
eventually, I will slide this all into the manager, maybe. |
Parameters: name Name of VM to add sourceTemplate Source template that contains the defintion of the VM
Returns: true if it is allowed to be added, false otherwise