|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.i18n.AbstractMessagesImpl
public abstract class AbstractMessagesImpl
Provides localized strings. You should uses the ContextMessages class if you can provide a request object. AbstractMessagesImpl will do the job as good as possible without to know the session (user) and all the other contextual things. Endusers will use the MessageManager to resolve messages.
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
protected |
AbstractMessagesImpl(String basename,
Locale locale)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface info.magnolia.cms.i18n.Messages |
---|
get, keys, reload |
Field Detail |
---|
protected org.slf4j.Logger log
public static final String JS_OBJECTNAME
protected String basename
protected Locale locale
protected ResourceBundle bundle
Constructor Detail |
---|
protected AbstractMessagesImpl(String basename, Locale locale)
Method Detail |
---|
public Locale getLocale()
getLocale
in interface Messages
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 message
public String getWithDefault(String key, Object[] args, String defaultMsg)
getWithDefault
in interface Messages
key
- keyargs
- replacement stringsdefaultMsg
- default message
public boolean equals(Object arg0)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |