类 ToolInfo
java.lang.Object
org.apache.velocity.tools.ToolInfo
- 所有已实现的接口:
Serializable
- 直接已知子类:
OldToolInfo
Manages data needed to create instances of a tool. New instances
are returned for every call to create(obj).
- 版本:
- $Id: ToolInfo.java 511959 2007-02-26 19:24:39Z nbubna $
- 作者:
- Nathan Bubna, Henning P. Schmiedehausen
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
addProperties
(Map<String, Object> parentProps) Adds a map of properties from a parent scope to the properties for this tool.protected void
Actually performs configuration of the newly instantiated tool using the combined final set of configuration properties.Returns a new instance of the tool.protected Method
getKey()
AccessorsgetProps()
boolean
boolean
hasPermission
(String path) protected void
boolean
protected Object
putProperty
(String name, Object value) Puts a new property for this tool.void
restrictTo
(String path) void
Tries to create an instance of the specified Class, then looks for a configure(Map<String,Object>) method.void
Mutatorsprotected void
setProperty
(Object tool, String name, Object value) void
setSkipSetters
(boolean cfgOnly)
-
字段详细资料
-
构造器详细资料
-
ToolInfo
Creates a new instance using the minimum required info necessary for a tool.
-
-
方法详细资料
-
setKey
Mutators -
setClass
Tries to create an instance of the specified Class, then looks for a configure(Map<String,Object>) method.- 参数:
clazz
- the java.lang.Class of the tool
-
restrictTo
- 参数:
path
- the full or partial request path restriction of the tool
-
setSkipSetters
public void setSkipSetters(boolean cfgOnly) -
addProperties
Adds a map of properties from a parent scope to the properties for this tool. Only new properties will be added; any that are already set for this tool will be ignored. -
putProperty
Puts a new property for this tool. -
getProps
-
getKey
Accessors -
getClassname
-
getToolClass
-
getProperties
-
hasConfigure
public boolean hasConfigure() -
isSkipSetters
public boolean isSkipSetters() -
hasPermission
- 参数:
path
- the path of a template requesting this tool- 返回:
true
if the specified request path matches the restrictions of this tool. If there is no request path restriction for this tool, it will always returntrue
.
-
create
Returns a new instance of the tool. If the tool has an configure(Map) method, the new instance will be initialized using the given properties combined with whatever "constant" properties have been put into this ToolInfo. -
configure
Actually performs configuration of the newly instantiated tool using the combined final set of configuration properties. First, if the class lacks theSkipSetters
annotation, then any specific setters matching the configuration keys are called, then the general configure(Map) method (if any) is called. -
getConfigure
-
newInstance
-
invoke
-
setProperty
- 抛出:
Exception
-
combine
-