org.apache.struts2.portlet

## Class PortletApplicationMap

- java.lang.Object
- - java.util.AbstractMap<String,Object>
  - - org.apache.struts2.portlet.PortletApplicationMap

- All Implemented Interfaces:
    Serializable, Map<String,Object>

      public class PortletApplicationMap
      extends AbstractMap<String,Object>
      implements Serializable

  Portlet specific `Map` implementation representing the `PortletContext` of a Portlet.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `Map.Entry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PortletApplicationMap(javax.portlet.PortletContext ctx)` Creates a new map object given the `PortletContext`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Removes all entries from the Map and removes all attributes from the portlet context.
    `Set<Map.Entry<String,Object>>` | `entrySet()` Creates a Set of all portlet context attributes as well as context init parameters.
    `Object` | `get(Object key)` Returns the portlet context attribute or init parameter based on the given key.
    `Object` | `put(String key, Object value)` Sets a portlet context attribute given a attribute name and value.
    `Object` | `remove(String key)` Removes the specified portlet context attribute.

    - ### Methods inherited from class java.util.AbstractMap

      `clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Constructor Detail

    - #### PortletApplicationMap

          public PortletApplicationMap(javax.portlet.PortletContext ctx)

      Creates a new map object given the `PortletContext`.
      Parameters:
        `ctx` - The portlet context.

  - ### Method Detail

    - #### clear

          public void clear()

      Removes all entries from the Map and removes all attributes from the portlet context.
      Specified by:
        `clear` in interface `Map<String,Object>`
      Overrides:
        `clear` in class `AbstractMap<String,Object>`

    - #### entrySet

          public Set<Map.Entry<String,Object>> entrySet()

      Creates a Set of all portlet context attributes as well as context init parameters.
      Specified by:
        `entrySet` in interface `Map<String,Object>`
      Specified by:
        `entrySet` in class `AbstractMap<String,Object>`
      Returns:
        a Set of all portlet context attributes as well as context init parameters.

    - #### get

          public Object get(Object key)

      Returns the portlet context attribute or init parameter based on the given key. If the entry is not found, `null` is returned.
      Specified by:
        `get` in interface `Map<String,Object>`
      Overrides:
        `get` in class `AbstractMap<String,Object>`
      Parameters:
        `key` - the entry key.
      Returns:
        the portlet context attribute or init parameter or `null` if the entry is not found.

    - #### put

          public Object put(String key,
                            Object value)

      Sets a portlet context attribute given a attribute name and value.
      Specified by:
        `put` in interface `Map<String,Object>`
      Overrides:
        `put` in class `AbstractMap<String,Object>`
      Parameters:
        `key` - the name of the attribute.
        `value` - the value to set.
      Returns:
        the attribute that was just set.

    - #### remove

          public Object remove(String key)

      Removes the specified portlet context attribute.
      Parameters:
        `key` - the attribute to remove.
      Returns:
        the entry that was just removed.

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.