Package org.apache.velocity.tools
Class Toolbox
java.lang.Object
org.apache.velocity.tools.Toolbox
- All Implemented Interfaces:
Serializable
Instances of this class are typically created by a ToolboxFactory
on 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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected Object
getFromCache
(String key, String path) protected Object
getKeys()
protected boolean
hasPermission
(ToolInfo info, String path)
-
Field Details
-
KEY
The key used to place instances in various scopes. -
serialVersionUID
private static final long serialVersionUID- See Also:
-
infoMap
-
properties
-
cache
-
-
Constructor Details
-
Toolbox
-
Toolbox
-
-
Method Details
-
cacheData
-
getProperties
-
get
-
get
-
get
-
get
-
getFromCache
-
getFromInfo
-
hasPermission
-
getKeys
-
getToolClassMap
Return a newMap
link tools' keys to theirClass
es. 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. -
getAll
-
combine
-