|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.tools.ToolInfo
public class ToolInfo
Manages data needed to create instances of a tool. New instances are returned for every call to create(obj).
Field Summary | |
---|---|
static String |
CONFIGURE_METHOD_NAME
|
Constructor Summary | |
---|---|
ToolInfo(String key,
Class clazz)
Creates a new instance using the minimum required info necessary for a tool. |
Method Summary | |
---|---|
void |
addProperties(Map<String,Object> parentProps)
Adds a map of properties from a parent scope to the properties for this tool. |
protected Map<String,Object> |
combine(Map<String,Object>... maps)
|
protected void |
configure(Object tool,
Map<String,Object> configuration)
Actually performs configuration of the newly instantiated tool using the combined final set of configuration properties. |
Object |
create(Map<String,Object> dynamicProperties)
Returns a new instance of the tool. |
String |
getClassname()
|
protected Method |
getConfigure()
|
String |
getKey()
Accessors |
Map<String,Object> |
getProperties()
|
protected Map<String,Object> |
getProps()
|
Class |
getToolClass()
|
boolean |
hasConfigure()
|
boolean |
hasPermission(String path)
|
protected void |
invoke(Method method,
Object tool,
Object param)
|
boolean |
isSkipSetters()
|
protected Object |
newInstance()
|
Object |
putProperty(String name,
Object value)
Puts a new property for this tool. |
void |
restrictTo(String path)
|
void |
setClass(Class clazz)
Tries to create an instance of the specified Class, then looks for a configure(Map |
void |
setKey(String key)
Mutators |
protected void |
setProperty(Object tool,
String name,
Object value)
|
void |
setSkipSetters(boolean cfgOnly)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONFIGURE_METHOD_NAME
Constructor Detail |
---|
public ToolInfo(String key, Class clazz)
Method Detail |
---|
public void setKey(String key)
public void setClass(Class clazz)
clazz
- the java.lang.Class of the toolpublic void restrictTo(String path)
path
- the full or partial request path restriction of the toolpublic void setSkipSetters(boolean cfgOnly)
public void addProperties(Map<String,Object> parentProps)
public Object putProperty(String name, Object value)
protected Map<String,Object> getProps()
public String getKey()
public String getClassname()
public Class getToolClass()
public Map<String,Object> getProperties()
public boolean hasConfigure()
public boolean isSkipSetters()
public boolean hasPermission(String path)
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 return true
.public Object create(Map<String,Object> dynamicProperties)
protected void configure(Object tool, Map<String,Object> configuration)
SkipSetters
annotation, then any
specific setters matching the configuration keys are called, then
the general configure(Map) method (if any) is called.
protected Method getConfigure()
protected Object newInstance()
protected void invoke(Method method, Object tool, Object param)
protected void setProperty(Object tool, String name, Object value) throws Exception
Exception
protected Map<String,Object> combine(Map<String,Object>... maps)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |