public abstract class AbstractMessagesImpl extends Object implements Messages
Modifier and Type | Field and Description |
---|---|
protected String |
basename
The name of the bundle.
|
protected ResourceBundle |
bundle
The current bundle.
|
static String |
JS_OBJECTNAME
Name of the javascript object used to make the messages public to the javascripts.
|
protected Locale |
locale
The current locale.
|
protected org.slf4j.Logger |
log |
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessagesImpl(String basename,
Locale locale) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object arg0)
True if the basename and the locale are the same.
|
String |
get(String key,
Object[] args)
Replace the {n} parameters in the string.
|
String |
getBasename()
If no basename is provided this method returns DEFAULT_BASENAME.
|
Locale |
getLocale()
Returns the current locale.
|
String |
getWithDefault(String key,
Object[] args,
String defaultMsg)
With default value and replacement strings.
|
String |
getWithDefault(String key,
String defaultMsg)
You can provide a default value if the key is not found.
|
String |
toString()
Nice string.
|
protected org.slf4j.Logger log
public static final String JS_OBJECTNAME
protected String basename
protected Locale locale
protected ResourceBundle bundle
public Locale getLocale()
public String getBasename()
getBasename
in interface Messages
public String get(String key, Object[] args)
get
in interface Messages
MessageFormat.format(String, Object[])
public String getWithDefault(String key, String defaultMsg)
getWithDefault
in interface Messages
key
- keydefaultMsg
- the default messagepublic String getWithDefault(String key, Object[] args, String defaultMsg)
getWithDefault
in interface Messages
key
- keyargs
- replacement stringsdefaultMsg
- default messagepublic boolean equals(Object arg0)
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.