Package org.apache.felix.webconsole
Class DefaultVariableResolver
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap
-
- org.apache.felix.webconsole.DefaultVariableResolver
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
,VariableResolver
public class DefaultVariableResolver extends HashMap implements VariableResolver
TheDefaultVariableResolver
is aHashMap
based default implementation of theVariableResolver
interface. It may be used by plugins to implement the interface for the request and is also used by theWebConsoleUtil.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 class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description DefaultVariableResolver()
Creates a new variable resolver with default capacity.DefaultVariableResolver(int initialCapacity)
Creates a new variable resolver with specified initial capacityDefaultVariableResolver(int initialCapacity, float loadFactor)
Creates a new variable resolver and initializes both - capacity & load factorDefaultVariableResolver(Map source)
Creates a new variable resolver copying the variables from the given map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
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 containerloadFactor
- the load factor of the variable container- See Also:
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(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(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 interfaceVariableResolver
- 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.
-
-