org.apache.velocity.tools
Class ToolManager

java.lang.Object
  extended by org.apache.velocity.tools.ToolManager

public class ToolManager
extends java.lang.Object

Manages tools for non-web applications. This simplifies the process of getting a tool-populated Velocity context for merging with templates. It allows for both direct configuration by passing in a FactoryConfiguration as well as configuration via a tools.xml or tools.properties file in either the classpath or the local file system.

Version:
$Id: ToolManager.java 511959 2007-02-26 19:24:39Z nbubna $
Author:
Nathan Bubna

Field Summary
private  Toolbox application
           
private  org.apache.velocity.app.VelocityEngine engine
           
private  ToolboxFactory factory
           
 
Constructor Summary
ToolManager()
          Constructs an instance already configured to use the ConfigurationUtils.getAutoLoaded()() configuration and any configuration specified via a "org.apache.velocity.tools" system property.
ToolManager(boolean includeDefaults)
           
 
Method Summary
protected  void addToolboxes(ToolContext context)
           
 void configure(FactoryConfiguration config)
           
 void configure(java.lang.String path)
           
 ToolContext createContext()
           
 ToolContext createContext(java.util.Map<java.lang.String,java.lang.Object> toolProps)
           
protected  Toolbox getApplicationToolbox()
           
protected  Toolbox getRequestToolbox()
           
protected  boolean hasApplicationTools()
           
protected  boolean hasRequestTools()
           
 void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

private org.apache.velocity.app.VelocityEngine engine

factory

private ToolboxFactory factory

application

private Toolbox application
Constructor Detail

ToolManager

public ToolManager()
Constructs an instance already configured to use the ConfigurationUtils.getAutoLoaded()() configuration and any configuration specified via a "org.apache.velocity.tools" system property.


ToolManager

public ToolManager(boolean includeDefaults)
Method Detail

configure

public void configure(FactoryConfiguration config)

configure

public void configure(java.lang.String path)

setVelocityEngine

public void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)

createContext

public ToolContext createContext()

createContext

public ToolContext createContext(java.util.Map<java.lang.String,java.lang.Object> toolProps)

addToolboxes

protected void addToolboxes(ToolContext context)

hasRequestTools

protected boolean hasRequestTools()

getRequestToolbox

protected Toolbox getRequestToolbox()

hasApplicationTools

protected boolean hasApplicationTools()

getApplicationToolbox

protected Toolbox getApplicationToolbox()


Copyright (c) 2003-2007 Apache Software Foundation