org.apache.velocity.tools.generic
Class AbstractLockConfig

java.lang.Object
  extended by org.apache.velocity.tools.generic.AbstractLockConfig
Direct Known Subclasses:
AlternatorTool, DisplayTool, LocaleConfig, RenderTool

public abstract class AbstractLockConfig
extends java.lang.Object

Implements common logic and constants for tools which by default lock down the public configure(Map) method, to keep the tool thread-safe in templates and most other common uses.

Author:
Nathan Bubna

Field Summary
private  boolean configLocked
           
static java.lang.String LOCK_CONFIG_KEY
          The key used for specifying whether or not to prevent templates from reconfiguring this tool.
 
Constructor Summary
AbstractLockConfig()
           
 
Method Summary
 void configure(java.util.Map params)
          Looks for configuration values in the given params.
protected abstract  void configure(ValueParser values)
          Does the actual configuration.
 boolean isConfigLocked()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCK_CONFIG_KEY

public static final java.lang.String LOCK_CONFIG_KEY
The key used for specifying whether or not to prevent templates from reconfiguring this tool. The default is true.

See Also:
Constant Field Values

configLocked

private boolean configLocked
Constructor Detail

AbstractLockConfig

public AbstractLockConfig()
Method Detail

isConfigLocked

public boolean isConfigLocked()

configure

public void configure(java.util.Map params)
Looks for configuration values in the given params.


configure

protected abstract void configure(ValueParser values)
Does the actual configuration. This is protected, so subclasses may share the same ValueParser and call configure at any time, while preventing templates from doing so when configure(Map) is locked.



Copyright (c) 2003-2007 Apache Software Foundation