Package org.apache.velocity.tools
Class Toolbox
- java.lang.Object
-
- org.apache.velocity.tools.Toolbox
-
- All Implemented Interfaces:
Serializable
public class Toolbox extends Object implements Serializable
Instances of this class are typically created by a
ToolboxFactoryon a one-per-scope basis. So, for each application, there would be one application-scoped Toolbox from which you would retrieve tool instances, and for each request, there would be one request-scoped Toolbox. Of course, none of the above is enforced. There's no reason that you can't manually create a Toolbox or have multiple Toolboxes for each scope.When a Toolbox creates a tool instance asked of it (see
get(java.lang.String)), it will cache that instance for future requests.- Version:
- $Id: Toolbox.java 511959 2007-02-26 19:24:39Z nbubna $
- Author:
- Nathan Bubna
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcacheData(Map<String,Object> data)Toolboxcombine(Toolbox... toolboxes)Objectget(String key)Objectget(String key, String path)Objectget(String key, String path, Map<String,Object> context)Objectget(String key, Map<String,Object> context)Map<String,Object>getAll(Map<String,Object> context)protected ObjectgetFromCache(String key, String path)protected ObjectgetFromInfo(String key, String path, Map<String,Object> context)Set<String>getKeys()Map<String,Object>getProperties()Map<String,Class>getToolClassMap()protected booleanhasPermission(ToolInfo info, String path)
-
-
-
Field Detail
-
KEY
public static final String KEY
The key used to place instances in various scopes.
-
-
Method Detail
-
getToolClassMap
public Map<String,Class> getToolClassMap()
Return a newMaplink tools' keys to theirClasses. This will not instantiate any tools, it is merely informational. This will not include the keys for any cached data. Note that inclusion in this map does NOT mean that all these tools will be available for all requests, as this map ignores all path restrictions on the tools.
-
-