public class MessagesMap
extends java.lang.Object
implements java.util.Map
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 and Description |
|---|
MessagesMap(MessageResources messages,
java.util.Locale locale)
Construct a new
MessagesMap instance that wraps the
specified MessageResources instance, and returns messages
for the specified Locale. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
The
clear() method is not supported. |
boolean |
containsKey(java.lang.Object key)
Return
true if there is a message for the
specified key. |
boolean |
containsValue(java.lang.Object value)
The
containsValue() method is not supported. |
java.util.Set |
entrySet()
The
entrySet() method is not supported. |
boolean |
equals(java.lang.Object o)
The
equals method checks whether equal
MessageResources and Locale are
being wrapped. |
java.lang.Object |
get(java.lang.Object key)
Return the message string for the specified key.
|
int |
hashCode()
The
hashCode() method returns values that will
be identical if the equals method returns true. |
boolean |
isEmpty()
The
isEmpty() method returns false, on the
assumption that there is always at least one message available. |
java.util.Set |
keySet()
The
keySet() method is not supported. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
The
put() method is not supported. |
void |
putAll(java.util.Map map)
The
putAll() method is not supported. |
java.lang.Object |
remove(java.lang.Object key)
The
remove() method is not supported. |
int |
size()
The
size() method is not supported. |
java.util.Collection |
values()
The
values() method is not supported. |
public MessagesMap(MessageResources messages, java.util.Locale locale)
Construct a new MessagesMap instance that wraps the
specified MessageResources instance, and returns messages
for the specified Locale.
messages - MessageResources instance to wraplocale - Locale for which to retrieve messages,
or null for the system default Localejava.lang.NullPointerException - if messages
is nullpublic void clear()
The clear() method is not supported.
clear in interface java.util.Mappublic boolean containsKey(java.lang.Object key)
Return true if there is a message for the
specified key.
containsKey in interface java.util.Mapkey - Message key to evaluatepublic boolean containsValue(java.lang.Object value)
The containsValue() method is not supported.
containsValue in interface java.util.Mapvalue - Value to evaluatepublic java.util.Set entrySet()
The entrySet() method is not supported.
entrySet in interface java.util.Mappublic boolean equals(java.lang.Object o)
The equals method checks whether equal
MessageResources and Locale are
being wrapped.
equals in interface java.util.Mapequals in class java.lang.Objecto - The object to be comparedpublic java.lang.Object get(java.lang.Object key)
Return the message string for the specified key.
get in interface java.util.Mapkey - Key for message to returnpublic int hashCode()
The hashCode() method returns values that will
be identical if the equals method returns true.
hashCode in interface java.util.MaphashCode in class java.lang.Objectpublic boolean isEmpty()
The isEmpty() method returns false, on the
assumption that there is always at least one message available.
isEmpty in interface java.util.Mappublic java.util.Set keySet()
The keySet() method is not supported.
keySet in interface java.util.Mappublic java.lang.Object put(java.lang.Object key,
java.lang.Object value)
The put() method is not supported.
put in interface java.util.Mapkey - Key to storevalue - Value to storepublic void putAll(java.util.Map map)
The putAll() method is not supported.
putAll in interface java.util.Mapmap - Keys and values to storepublic java.lang.Object remove(java.lang.Object key)
The remove() method is not supported.
remove in interface java.util.Mapkey - Key to removepublic int size()
The size() method is not supported.
size in interface java.util.Mappublic java.util.Collection values()
The values() method is not supported.
values in interface java.util.MapCopyright © 2000–2025 Apache Software Foundation. All rights reserved.