public class MessagesMap extends Object implements 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,
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(Object key)
Return
true if there is a message for the
specified key. |
boolean |
containsValue(Object value)
The
containsValue() method is not supported. |
Set |
entrySet()
The
entrySet() method is not supported. |
boolean |
equals(Object o)
The
equals method checks whether equal
MessageResources and Locale are
being wrapped. |
Object |
get(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. |
Set |
keySet()
The
keySet() method is not supported. |
Object |
put(Object key,
Object value)
The
put() method is not supported. |
void |
putAll(Map map)
The
putAll() method is not supported. |
Object |
remove(Object key)
The
remove() method is not supported. |
int |
size()
The
size() method is not supported. |
Collection |
values()
The
values() method is not supported. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public MessagesMap(MessageResources messages, 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 Locale
NullPointerException
- if messages
is null
public boolean containsKey(Object key)
Return true
if there is a message for the
specified key.
containsKey
in interface Map
key
- Message key to evaluatepublic boolean containsValue(Object value)
The containsValue()
method is not supported.
containsValue
in interface Map
value
- Value to evaluatepublic Set entrySet()
The entrySet()
method is not supported.
public boolean equals(Object o)
The equals
method checks whether equal
MessageResources
and Locale
are
being wrapped.
public int hashCode()
The hashCode()
method returns values that will
be identical if the equals
method returns true
.
public boolean isEmpty()
The isEmpty()
method returns false
, on the
assumption that there is always at least one message available.
public Set keySet()
The keySet()
method is not supported.
public void putAll(Map map)
The putAll()
method is not supported.
public Collection values()
The values()
method is not supported.
Copyright © 2000–2017 Apache Software Foundation. All rights reserved.