Class StringKeyedMapAdapter<V>

java.lang.Object
org.springframework.binding.collection.StringKeyedMapAdapter<V>
All Implemented Interfaces:
Map<String,V>
Direct Known Subclasses:
HttpServletContextMap, HttpServletRequestMap, HttpServletRequestParameterMap, HttpSessionMap

public abstract class StringKeyedMapAdapter<V> extends Object implements Map<String,V>
Base class for map adapters whose keys are String values. Concrete classes need only implement the abstract hook methods defined by this class.
Author:
Keith Donald
  • Constructor Details

    • StringKeyedMapAdapter

      public StringKeyedMapAdapter()
  • Method Details

    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,V>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,V>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,V>
    • entrySet

      public Set<Map.Entry<String,V>> entrySet()
      Specified by:
      entrySet in interface Map<String,V>
    • get

      public V get(Object key)
      Specified by:
      get in interface Map<String,V>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,V>
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,V>
    • put

      public V put(String key, V value)
      Specified by:
      put in interface Map<String,V>
    • putAll

      public void putAll(Map<? extends String,? extends V> map)
      Specified by:
      putAll in interface Map<String,V>
    • remove

      public V remove(Object key)
      Specified by:
      remove in interface Map<String,V>
    • size

      public int size()
      Specified by:
      size in interface Map<String,V>
    • values

      public Collection<V> values()
      Specified by:
      values in interface Map<String,V>
    • getAttribute

      protected abstract V getAttribute(String key)
      Hook method that needs to be implemented by concrete subclasses. Gets a value associated with a key.
      Parameters:
      key - the key to lookup
      Returns:
      the associated value, or null if none
    • setAttribute

      protected abstract void setAttribute(String key, V value)
      Hook method that needs to be implemented by concrete subclasses. Puts a key-value pair in the map, overwriting any possible earlier value associated with the same key.
      Parameters:
      key - the key to associate the value with
      value - the value to associate with the key
    • removeAttribute

      protected abstract void removeAttribute(String key)
      Hook method that needs to be implemented by concrete subclasses. Removes a key and its associated value from the map.
      Parameters:
      key - the key to remove
    • getAttributeNames

      protected abstract Iterator<String> getAttributeNames()
      Hook method that needs to be implemented by concrete subclasses. Returns an enumeration listing all keys known to the map.
      Returns:
      the key enumeration