|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.runtime.VelocimacroFactory
VelocimacroFactory.java manages the set of VMs in a running Velocity engine.
Inner Class Summary | |
private class |
VelocimacroFactory.Twonk
small continer class to hold the duple of a template and modification time. |
Field Summary | |
private boolean |
addNewAllowed
controls if new VMs can be added. |
private boolean |
autoReloadLibrary
determines if the libraries are auto-loaded when they change |
private boolean |
blather
controls log output |
private java.util.Map |
libModMap
map of the library Template objects used for reload determination |
private java.util.Vector |
macroLibVec
vector of the library names |
private boolean |
replaceAllowed
determines if replacement of global VMs are allowed controlled by VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL |
private RuntimeServices |
rsvc
runtime services for this instance |
private boolean |
templateLocal
sets if template-local namespace in used |
private 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(java.lang.String name,
java.lang.String macroBody,
java.lang.String[] argArray,
java.lang.String sourceTemplate)
adds a macro to the factory. |
private boolean |
canAddVelocimacro(java.lang.String name,
java.lang.String sourceTemplate)
determines if a given macro/namespace (name, source) combo is allowed to be added |
boolean |
dumpVMNamespace(java.lang.String namespace)
tells the vmManager to dump the specified namespace |
private boolean |
getAutoload()
get the switch for automatic reloading of global library-based VMs |
private boolean |
getBlather()
get output message mode |
private boolean |
getTemplateLocalInline()
|
Directive |
getVelocimacro(java.lang.String vmName,
java.lang.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(java.lang.String vm,
java.lang.String sourceTemplate)
Tells the world if a given directive string is a Velocimacro |
private void |
logVMMessageInfo(java.lang.String s)
localization of the logging logic |
private void |
logVMMessageWarn(java.lang.String s)
localization of the logging logic |
private boolean |
setAddMacroPermission(boolean arg)
sets the permission to add new macros |
private void |
setAutoload(boolean b)
set the switch for automatic reloading of global library-based VMs |
private void |
setBlather(boolean b)
set output message mode |
private boolean |
setReplacementPermission(boolean arg)
sets the permission for allowing addMacro() calls to replace existing VM's |
private 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. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private RuntimeServices rsvc
private VelocimacroManager vmManager
private boolean replaceAllowed
private boolean addNewAllowed
private boolean templateLocal
private boolean blather
private boolean autoReloadLibrary
private java.util.Vector macroLibVec
private java.util.Map libModMap
Constructor Detail |
public VelocimacroFactory(RuntimeServices rs)
Method Detail |
public void initVelocimacro()
public boolean addVelocimacro(java.lang.String name, java.lang.String macroBody, java.lang.String[] argArray, java.lang.String sourceTemplate)
private boolean canAddVelocimacro(java.lang.String name, java.lang.String sourceTemplate)
name
- Name of VM to addsourceTemplate
- Source template that contains the defintion of the VMprivate void logVMMessageInfo(java.lang.String s)
private void logVMMessageWarn(java.lang.String s)
public boolean isVelocimacro(java.lang.String vm, java.lang.String sourceTemplate)
public Directive getVelocimacro(java.lang.String vmName, java.lang.String sourceTemplate)
public boolean dumpVMNamespace(java.lang.String namespace)
private void setTemplateLocalInline(boolean b)
private boolean getTemplateLocalInline()
private boolean setAddMacroPermission(boolean arg)
private boolean setReplacementPermission(boolean arg)
private void setBlather(boolean b)
private boolean getBlather()
private void setAutoload(boolean b)
private boolean getAutoload()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |