public class ToolInfo extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
CONFIGURE_METHOD_NAME |
Constructor and Description |
---|
ToolInfo(String key,
Class clazz)
Creates a new instance using the minimum required info
necessary for a tool.
|
Modifier and Type | Method and Description |
---|---|
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) |
public static final String CONFIGURE_METHOD_NAME
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 String getKey()
public String getClassname()
public Class getToolClass()
public boolean hasConfigure()
public boolean isSkipSetters()
public boolean hasPermission(String path)
path
- the path of a template requesting this tooltrue
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 setProperty(Object tool, String name, Object value) throws Exception
Exception
Copyright © 2002–2016 Apache Software Foundation. All rights reserved.