Class ImplicitObjectELResolver.EnumeratedMap<K,V>

java.lang.Object
jakarta.servlet.jsp.el.ImplicitObjectELResolver.EnumeratedMap<K,V>
All Implemented Interfaces:
Map<K,V>
Enclosing class:
ImplicitObjectELResolver

private abstract static class ImplicitObjectELResolver.EnumeratedMap<K,V> extends Object implements Map<K,V>

This is a Map implementation driven by a data source that only provides an enumeration of keys and a getValue(key) method. This class must be subclassed to implement those methods.

Some of the methods may incur a performance penalty that involves enumerating the entire data source. In these cases, the Map will try to save the results of that enumeration, but only if the underlying data source is immutable.

  • Field Details

  • Constructor Details

    • EnumeratedMap

      private EnumeratedMap()
  • Method Details

    • clear

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

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

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

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

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

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

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

      public V put(K pKey, V pValue)
      Specified by:
      put in interface Map<K,V>
    • putAll

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

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

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

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

      public abstract Enumeration<K> enumerateKeys()
      Returns:
      an enumeration of the keys
    • isMutable

      public abstract boolean isMutable()
      Returns:
      true if it is possible for this data source to change
    • getValue

      public abstract V getValue(Object pKey)
      Parameters:
      pKey - The key for which the value should be obtained
      Returns:
      the value associated with the given key, or null if not found.
    • getAsMap

      public Map<K,V> getAsMap()
      Converts the MapSource to a Map. If the map is not mutable, this is cached
      Returns:
      A Map created from the source Enumeration
    • convertToMap

      Map<K,V> convertToMap()
      Converts to a Map