org.apache.velocity.runtime
Class VelocimacroManager

java.lang.Object
  extended by org.apache.velocity.runtime.VelocimacroManager

public class VelocimacroManager
extends Object

Manages VMs in namespaces. Currently, two namespace modes are supported:

Thanks to Jose Alberto Fernandez for some ideas incorporated here.

Version:
$Id: VelocimacroManager.java 191743 2005-06-21 23:22:20Z dlr $
Author:
Geir Magnusson Jr., Jose Alberto Fernandez

Nested Class Summary
protected  class VelocimacroManager.MacroEntry
          wrapper class for holding VM information
 
Method Summary
 boolean addVM(String vmName, String macroBody, String[] argArray, String namespace)
          Adds a VM definition to the cache.
 boolean dumpNamespace(String namespace)
          Removes the VMs and the namespace from the manager.
 VelocimacroProxy get(String vmName, String namespace)
          gets a new living VelocimacroProxy object by the name / source template duple
 String getLibraryName(String vmName, String namespace)
           
 void setNamespaceUsage(boolean b)
          public switch to let external user of manager to control namespace usage indep of properties.
 void setRegisterFromLib(boolean b)
           
 void setTemplateLocalInlineVM(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addVM

public boolean addVM(String vmName,
                     String macroBody,
                     String[] argArray,
                     String namespace)
Adds a VM definition to the cache.

Returns:
Whether everything went okay.

get

public VelocimacroProxy get(String vmName,
                            String namespace)
gets a new living VelocimacroProxy object by the name / source template duple


dumpNamespace

public boolean dumpNamespace(String namespace)
Removes the VMs and the namespace from the manager. Used when a template is reloaded to avoid accumulating drek

Parameters:
namespace - namespace to dump
Returns:
boolean representing success

setNamespaceUsage

public void setNamespaceUsage(boolean b)
public switch to let external user of manager to control namespace usage indep of properties. That way, for example, at startup the library files are loaded into global namespace


setRegisterFromLib

public void setRegisterFromLib(boolean b)

setTemplateLocalInlineVM

public void setTemplateLocalInlineVM(boolean b)

getLibraryName

public String getLibraryName(String vmName,
                             String namespace)


Copyright © 2002 Apache Software Foundation. All Rights Reserved.