org.apache.felix.webconsole
Class DefaultVariableResolver

java.lang.Object
  extended by java.util.AbstractMap
      extended by java.util.HashMap
          extended by org.apache.felix.webconsole.DefaultVariableResolver
All Implemented Interfaces:
Serializable, Cloneable, Map, VariableResolver

public class DefaultVariableResolver
extends HashMap
implements VariableResolver

The DefaultVariableResolver is a HashMap based default implementation of the VariableResolver interface. It may be used by plugins to implement the interface for the request and is also used by the WebConsoleUtil.getVariableResolver(javax.servlet.ServletRequest) as the variable resolver if none has yet been assigned to the request.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry
 
Constructor Summary
DefaultVariableResolver()
          Creates a new variable resolver with default capacity.
DefaultVariableResolver(int initialCapacity)
          Creates a new variable resolver with specified initial capacity
DefaultVariableResolver(int initialCapacity, float loadFactor)
          Creates a new variable resolver and initializes both - capacity & load factor
DefaultVariableResolver(Map source)
          Creates a new variable resolver copying the variables from the given map.
 
Method Summary
 String resolve(String variable)
          Returns the string representation of the value stored under the variable name in this map.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

DefaultVariableResolver

public DefaultVariableResolver()
Creates a new variable resolver with default capacity.


DefaultVariableResolver

public DefaultVariableResolver(int initialCapacity,
                               float loadFactor)
Creates a new variable resolver and initializes both - capacity & load factor

Parameters:
initialCapacity - the initial capacity of the variable container
loadFactor - the load factor of the variable container
See Also:
HashMap.HashMap(int, float)

DefaultVariableResolver

public DefaultVariableResolver(int initialCapacity)
Creates a new variable resolver with specified initial capacity

Parameters:
initialCapacity - the initial capacity of the variable container
See Also:
HashMap.HashMap(int)

DefaultVariableResolver

public DefaultVariableResolver(Map source)
Creates a new variable resolver copying the variables from the given map.

Parameters:
source - the map whose variables are to be placed in this resolver.
See Also:
HashMap.HashMap(Map)
Method Detail

resolve

public String resolve(String variable)
Returns the string representation of the value stored under the variable name in this map. If no value is stored under the variable name, null is returned.

Specified by:
resolve in interface VariableResolver
Parameters:
variable - The name of the variable whose value is to be returned.
Returns:
The variable value or null if there is no entry with the given name in this map.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.