org.tinyjee.maven.dim.sources
Class AbstractParametricVelocityTool<E extends AbstractParametricVelocityTool>

java.lang.Object
  extended by org.tinyjee.maven.dim.sources.AbstractParametricVelocityTool<E>
Direct Known Subclasses:
VelocityHighlightingTool, VelocitySourceClassInvocationTool

public class AbstractParametricVelocityTool<E extends AbstractParametricVelocityTool>
extends Object

Is an abstract base for tools that

Author:
Juergen_Kellerer, 2011-10-17

Constructor Summary
AbstractParametricVelocityTool()
           
 
Method Summary
 E clear()
          Clears all parameters form the internally maintained parameter list.
 String get(String key)
          Returns the current value of the internally stored parameter for the given key.
protected  Map<String,String> nextInvocationParameters()
          Creates the next parameters to be used to invoke a command inside this tool.
 E put(String key, String value)
          Sets a parameter that will be used with the next invocation.
 E remove(String key)
          Removes a parameter form the internally maintained parameter list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractParametricVelocityTool

public AbstractParametricVelocityTool()
Method Detail

get

public String get(String key)
Returns the current value of the internally stored parameter for the given key.

If a parameter is not internally stored, the method retrieves the default value for the given key from the request parameters. If there's no default value, 'null' will be returned.

Parameters:
key - the name of the parameter to get.
Returns:
the value of the parameter, may be 'null' if the parameter does not exist.

put

public E put(String key,
             String value)
Sets a parameter that will be used with the next invocation.

Parameters:
key - the name of the parameter to set.
value - the value to set.
Returns:
an instance of this tool to allow invocation chaining.

remove

public E remove(String key)
Removes a parameter form the internally maintained parameter list.

Parameters:
key - the name of the parameter to unset.
Returns:
an instance of this tool to allow invocation chaining.

clear

public E clear()
Clears all parameters form the internally maintained parameter list.

Returns:
an instance of this tool to allow invocation chaining.

nextInvocationParameters

protected Map<String,String> nextInvocationParameters()
Creates the next parameters to be used to invoke a command inside this tool.

Returns:
the next parameters to be used to invoke a command inside this tool.

toString

public String toString()
Overrides:
toString in class Object