|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.tools.ToolManager
public class ToolManager
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.
Field Summary | |
---|---|
private Toolbox |
application
|
protected ToolboxFactory |
factory
|
private boolean |
userOverwrite
|
protected org.apache.velocity.app.VelocityEngine |
velocity
|
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)
|
|
ToolManager(boolean autoConfig,
boolean includeDefaults)
|
Method Summary | |
---|---|
protected void |
addToolboxes(ToolContext context)
|
void |
autoConfigure(boolean includeDefaults)
|
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 |
createToolbox(java.lang.String scope)
|
protected void |
debug(java.lang.String msg,
java.lang.Object... args)
|
protected FactoryConfiguration |
findConfig(java.lang.String path)
|
protected Toolbox |
getApplicationToolbox()
|
org.apache.velocity.runtime.log.Log |
getLog()
|
protected Toolbox |
getRequestToolbox()
|
ToolboxFactory |
getToolboxFactory()
Returns the underlying ToolboxFactory being used. |
boolean |
getUserCanOverwriteTools()
|
org.apache.velocity.app.VelocityEngine |
getVelocityEngine()
|
protected boolean |
hasApplicationTools()
|
protected boolean |
hasRequestTools()
|
protected boolean |
hasTools(java.lang.String scope)
|
protected void |
prepareContext(ToolContext context)
|
void |
setToolboxFactory(ToolboxFactory factory)
Sets the underlying ToolboxFactory being used. |
void |
setUserCanOverwriteTools(boolean overwrite)
|
void |
setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)
Sets the underlying VelocityEngine being used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.velocity.app.VelocityEngine velocity
protected ToolboxFactory factory
private Toolbox application
private boolean userOverwrite
Constructor Detail |
---|
public ToolManager()
ConfigurationUtils.getAutoLoaded()
configuration
and any configuration specified via a "org.apache.velocity.tools"
system property.
public ToolManager(boolean includeDefaults)
public ToolManager(boolean autoConfig, boolean includeDefaults)
Method Detail |
---|
public void autoConfigure(boolean includeDefaults)
public void configure(FactoryConfiguration config)
public void configure(java.lang.String path)
protected FactoryConfiguration findConfig(java.lang.String path)
public ToolboxFactory getToolboxFactory()
ToolboxFactory
being used.
public void setToolboxFactory(ToolboxFactory factory)
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)
public org.apache.velocity.app.VelocityEngine getVelocityEngine()
public void setUserCanOverwriteTools(boolean overwrite)
public boolean getUserCanOverwriteTools()
public org.apache.velocity.runtime.log.Log getLog()
protected final void debug(java.lang.String msg, java.lang.Object... args)
public ToolContext createContext()
public ToolContext createContext(java.util.Map<java.lang.String,java.lang.Object> toolProps)
protected void prepareContext(ToolContext context)
protected void addToolboxes(ToolContext context)
protected boolean hasTools(java.lang.String scope)
protected Toolbox createToolbox(java.lang.String scope)
protected boolean hasRequestTools()
protected Toolbox getRequestToolbox()
protected boolean hasApplicationTools()
protected Toolbox getApplicationToolbox()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |