org.tinyjee.maven.dim.sources
Class VelocitySourceClassInvocationTool
java.lang.Object
org.tinyjee.maven.dim.sources.AbstractParametricVelocityTool<VelocitySourceClassInvocationTool>
org.tinyjee.maven.dim.sources.VelocitySourceClassInvocationTool
@DefaultKey(value="invoker")
public class VelocitySourceClassInvocationTool
- extends AbstractParametricVelocityTool<VelocitySourceClassInvocationTool>
Implements a custom velocity tool that can be used to invoke other source classes.
Usage within a template:
#set ($result = $invoker.clear().put('paramA', 'value').invokeClass('my.package.MyClass'))
Result: $result.get("key")
- Author:
- Juergen_Kellerer, 2011-10-14
VelocitySourceClassInvocationTool
public VelocitySourceClassInvocationTool()
invokeClass
public Map<String,Object> invokeClass(String className)
- Invokes the given 'source-class' compatible helper class.
- Parameters:
className
- the name of the class to invoke.
- Returns:
- The parameters that were generated by the class.
resolveClass
public Class<?> resolveClass(String className)
- Resolves the given 'source-class' providing access to use reflection.
- Parameters:
className
- the name of the class to resolve.
- Returns:
- The Class instance the resolved.