org.apache.velocity.runtime
Class VelocimacroFactory

java.lang.Object
  |
  +--org.apache.velocity.runtime.VelocimacroFactory

public class VelocimacroFactory
extends java.lang.Object

VelocimacroFactory.java manages the set of VMs in a running Velocity engine.

Version:
$Id: VelocimacroFactory.java,v 1.12 2001/03/20 01:11:15 jon Exp $
Author:
Geir Magnusson Jr.

Field Summary
private  boolean addNewAllowed
           
private  boolean blather
           
private  boolean replaceAllowed
           
private  boolean templateLocal
           
private  VelocimacroManager vmManager
           
 
Constructor Summary
VelocimacroFactory()
           
 
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.
 boolean dumpVMNamespace(java.lang.String namespace)
          tells the vmManager to dump the specified namespace
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()
          setup
 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 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
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

vmManager

private VelocimacroManager vmManager

replaceAllowed

private boolean replaceAllowed

addNewAllowed

private boolean addNewAllowed

templateLocal

private boolean templateLocal

blather

private boolean blather
Constructor Detail

VelocimacroFactory

public VelocimacroFactory()
Method Detail

initVelocimacro

public void initVelocimacro()
setup

addVelocimacro

public boolean addVelocimacro(java.lang.String name,
                              java.lang.String macroBody,
                              java.lang.String[] argArray,
                              java.lang.String sourceTemplate)
adds a macro to the factory.

logVMMessageInfo

private void logVMMessageInfo(java.lang.String s)
localization of the logging logic

logVMMessageWarn

private void logVMMessageWarn(java.lang.String s)
localization of the logging logic

isVelocimacro

public boolean isVelocimacro(java.lang.String vm,
                             java.lang.String sourceTemplate)
Tells the world if a given directive string is a Velocimacro

getVelocimacro

public 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

dumpVMNamespace

public boolean dumpVMNamespace(java.lang.String namespace)
tells the vmManager to dump the specified namespace

setTemplateLocalInline

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.

getTemplateLocalInline

private boolean getTemplateLocalInline()

setAddMacroPermission

private boolean setAddMacroPermission(boolean arg)
sets the permission to add new macros

setReplacementPermission

private boolean setReplacementPermission(boolean arg)
sets the permission for allowing addMacro() calls to replace existing VM's

setBlather

private void setBlather(boolean b)
set output message mode

getBlather

private boolean getBlather()
get output message mode


Copyright © 2001 Apache Software Foundation. All Rights Reserved.