public class LocaleDatabase extends TreeMap<String,String> implements Messages
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
LocaleDatabase(InputStream in,
Locales locales)
Constructs a
LocaleDatabase. |
LocaleDatabase(InputStream in,
Messages parent,
Locales locales)
Constructs a
LocaleDatabase. |
LocaleDatabase(Messages parent,
Locales locales)
Constructs a
LocaleDatabase. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(InputStream in)
Adds the contents of the given stream to the data base.
|
void |
add(Messages messages)
Adds messages.
|
String |
get(Object id)
Returns the message with the specified identifier.
|
String |
get(String id,
Object... args)
Formats the message with the specified identifier, replacing placeholders with the supplied arguments.
|
Map<String,String> |
getMessages()
Returns the messages.
|
String |
getString(String key,
String[] variables)
Convenience method to retrieve an element and simultaneously insert variables into the
string.
|
Messages |
newMessages(String name)
Creates a new messages instance from the named resource that inherits the current messages.
|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, valuesequals, hashCode, isEmpty, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, removepublic LocaleDatabase(InputStream in, Locales locales)
LocaleDatabase.in - the stream to read the translation fromlocales - the supported localesResourceException - if the stream is not an IzPack langpack filepublic LocaleDatabase(Messages parent, Locales locales)
LocaleDatabase.parent - the parent messages. May be nulllocales - the supported localespublic LocaleDatabase(InputStream in, Messages parent, Locales locales)
LocaleDatabase.in - the stream to read the translation from. May be nullparent - the parent messages. May be nulllocales - the supported localesResourceException - if the stream is not an IzPack langpack filepublic void add(InputStream in)
in - an InputStream to read the translation from.ResourceException - if the stream is not an IzPack langpack file or cannot be readpublic String get(String id, Object... args)
MessageFormat to format the message.public void add(Messages messages)
public Map<String,String> getMessages()
getMessages in interface Messagespublic Messages newMessages(String name)
newMessages in interface Messagesname - the messages resource namepublic String getString(String key, String[] variables)
key - The key of the element to retrieve.variables - the variables to insertCopyright © 2001–2025. All rights reserved.