public class MessageBundle extends Object
| Modifier and Type | Field and Description |
|---|---|
static MessageBundle |
EMPTY |
| Constructor and Description |
|---|
MessageBundle(Element element)
Constructs a message bundle from a /ModulePrefs/Locale with nested messages.
|
MessageBundle(LocaleSpec locale,
Map<String,String> map)
Constructs a message bundle from a prebuilt map.
|
MessageBundle(LocaleSpec locale,
String xml)
Constructs a message bundle from input xml (fetched from an external file).
|
MessageBundle(MessageBundle... bundles)
Create a MessageBundle by merging multiple bundles together.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getLanguageDirection() |
Map<String,String> |
getMessages() |
String |
toJSONString()
Return the message bundle contents as a JSON encoded string.
|
String |
toString() |
public static final MessageBundle EMPTY
public MessageBundle(LocaleSpec locale, String xml) throws SpecParserException
locale - The LocaleSpec element that this bundle was constructed from.xml - The content of the remote file.SpecParserException - if parsing fails.public MessageBundle(LocaleSpec locale, Map<String,String> map)
locale - The LocaleSpec element that this bundle was constructed from.map - The content of the message map.public MessageBundle(Element element) throws SpecParserException
element - XML Dom element to parseSpecParserException - when badly formed xml is providedpublic MessageBundle(MessageBundle... bundles)
bundles - the bundles to merge, in orderpublic String getLanguageDirection()
public String toJSONString()
Copyright © 2007-2012. All Rights Reserved.