Class MessagesMap

java.lang.Object
org.apache.struts.faces.util.MessagesMap
All Implemented Interfaces:
Map<String,String>

public class MessagesMap extends Object implements Map<String,String>
A limited immutable Map implementation that wraps the MessageResources instance for the specified Locale. Exposing the messages as a Map makes them easily accessible via value binding expressions, as well as JSP 2.0 expression language expressions.
  • Constructor Details

    • MessagesMap

      public MessagesMap(MessageResources messages, Locale locale)
      Construct a new MessagesMap instance that wraps the specified MessageResources instance, and returns messages for the specified Locale.
      Parameters:
      messages - MessageResources instance to wrap
      locale - Locale for which to retrieve messages, or null for the system default Locale
      Throws:
      NullPointerException - if messages is null
  • Method Details

    • clear

      public void clear()
      The clear() method is not supported.
      Specified by:
      clear in interface Map<String,String>
    • containsKey

      public boolean containsKey(Object key)
      Return true if there is a message for the specified key.
      Specified by:
      containsKey in interface Map<String,String>
      Parameters:
      key - Message key to evaluate
    • containsValue

      public boolean containsValue(Object value)
      The containsValue() method is not supported.
      Specified by:
      containsValue in interface Map<String,String>
      Parameters:
      value - Value to evaluate
    • entrySet

      public Set<Map.Entry<String,String>> entrySet()
      The entrySet() method is not supported.
      Specified by:
      entrySet in interface Map<String,String>
    • equals

      public boolean equals(Object o)
      The equals method checks whether equal MessageResources and Locale are being wrapped.
      Specified by:
      equals in interface Map<String,String>
      Overrides:
      equals in class Object
      Parameters:
      o - The object to be compared
    • get

      public String get(Object key)
      Return the message string for the specified key.
      Specified by:
      get in interface Map<String,String>
      Parameters:
      key - Key for message to return
    • hashCode

      public int hashCode()
      The hashCode() method returns values that will be identical if the equals method returns true.
      Specified by:
      hashCode in interface Map<String,String>
      Overrides:
      hashCode in class Object
    • isEmpty

      public boolean isEmpty()
      The isEmpty() method returns false, on the assumption that there is always at least one message available.
      Specified by:
      isEmpty in interface Map<String,String>
    • keySet

      public Set<String> keySet()
      The keySet() method is not supported.
      Specified by:
      keySet in interface Map<String,String>
    • put

      public String put(String key, String value)
      The put() method is not supported.
      Specified by:
      put in interface Map<String,String>
      Parameters:
      key - Key to store
      value - Value to store
    • putAll

      public void putAll(Map<? extends String,? extends String> map)
      The putAll() method is not supported.
      Specified by:
      putAll in interface Map<String,String>
      Parameters:
      map - Keys and values to store
    • remove

      public String remove(Object key)
      The remove() method is not supported.
      Specified by:
      remove in interface Map<String,String>
      Parameters:
      key - Key to remove
    • size

      public int size()
      The size() method is not supported.
      Specified by:
      size in interface Map<String,String>
    • values

      public Collection<String> values()
      The values() method is not supported.
      Specified by:
      values in interface Map<String,String>