|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 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()
|
Log |
getLog()
|
protected Toolbox |
getRequestToolbox()
|
ToolboxFactory |
getToolboxFactory()
Returns the underlying ToolboxFactory being used. |
boolean |
getUserCanOverwriteTools()
|
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(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 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(VelocityEngine engine)
public VelocityEngine getVelocityEngine()
public void setUserCanOverwriteTools(boolean overwrite)
public boolean getUserCanOverwriteTools()
public 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 |