|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 | |
---|---|
private java.lang.Class |
clazz
|
private java.lang.reflect.Method |
configure
|
static java.lang.String |
CONFIGURE_METHOD_NAME
|
private java.lang.String |
key
|
private java.util.Map<java.lang.String,java.lang.Object> |
properties
|
private java.lang.String |
restrictTo
|
private boolean |
restrictToIsExact
|
private static long |
serialVersionUID
|
private java.lang.Boolean |
skipSetters
|
Constructor Summary | |
---|---|
ToolInfo(java.lang.String key,
java.lang.Class clazz)
Creates a new instance using the minimum required info necessary for a tool. |
Method Summary | |
---|---|
void |
addProperties(java.util.Map<java.lang.String,java.lang.Object> parentProps)
Adds a map of properties from a parent scope to the properties for this tool. |
protected java.util.Map<java.lang.String,java.lang.Object> |
combine(java.util.Map<java.lang.String,java.lang.Object>... maps)
|
protected void |
configure(java.lang.Object tool,
java.util.Map<java.lang.String,java.lang.Object> configuration)
Actually performs configuration of the newly instantiated tool using the combined final set of configuration properties. |
java.lang.Object |
create(java.util.Map<java.lang.String,java.lang.Object> dynamicProperties)
Returns a new instance of the tool. |
java.lang.String |
getClassname()
|
protected java.lang.reflect.Method |
getConfigure()
|
java.lang.String |
getKey()
Accessors |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getProps()
|
java.lang.Class |
getToolClass()
|
boolean |
hasConfigure()
|
boolean |
hasPermission(java.lang.String path)
|
protected void |
invoke(java.lang.reflect.Method method,
java.lang.Object tool,
java.lang.Object param)
|
boolean |
isSkipSetters()
|
protected java.lang.Object |
newInstance()
|
java.lang.Object |
putProperty(java.lang.String name,
java.lang.Object value)
Puts a new property for this tool. |
void |
restrictTo(java.lang.String path)
|
void |
setClass(java.lang.Class clazz)
Tries to create an instance of the specified Class, then looks for a configure(Map |
void |
setKey(java.lang.String key)
Mutators |
protected void |
setProperty(java.lang.Object tool,
java.lang.String name,
java.lang.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 |
---|
private static final long serialVersionUID
public static final java.lang.String CONFIGURE_METHOD_NAME
private java.lang.String key
private java.lang.Class clazz
private boolean restrictToIsExact
private java.lang.String restrictTo
private java.util.Map<java.lang.String,java.lang.Object> properties
private java.lang.Boolean skipSetters
private transient java.lang.reflect.Method configure
Constructor Detail |
---|
public ToolInfo(java.lang.String key, java.lang.Class clazz)
Method Detail |
---|
public void setKey(java.lang.String key)
public void setClass(java.lang.Class clazz)
clazz
- the java.lang.Class of the toolpublic void restrictTo(java.lang.String path)
path
- the full or partial request path restriction of the toolpublic void setSkipSetters(boolean cfgOnly)
public void addProperties(java.util.Map<java.lang.String,java.lang.Object> parentProps)
public java.lang.Object putProperty(java.lang.String name, java.lang.Object value)
protected java.util.Map<java.lang.String,java.lang.Object> getProps()
public java.lang.String getKey()
public java.lang.String getClassname()
public java.lang.Class getToolClass()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
public boolean hasConfigure()
public boolean isSkipSetters()
public boolean hasPermission(java.lang.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 java.lang.Object create(java.util.Map<java.lang.String,java.lang.Object> dynamicProperties)
protected void configure(java.lang.Object tool, java.util.Map<java.lang.String,java.lang.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 java.lang.reflect.Method getConfigure()
protected java.lang.Object newInstance()
protected void invoke(java.lang.reflect.Method method, java.lang.Object tool, java.lang.Object param)
protected void setProperty(java.lang.Object tool, java.lang.String name, java.lang.Object value) throws java.lang.Exception
java.lang.Exception
protected java.util.Map<java.lang.String,java.lang.Object> combine(java.util.Map<java.lang.String,java.lang.Object>... maps)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |