|
||||||||||
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 java.lang.String |
basename
The name of the bundle. |
protected java.util.ResourceBundle |
bundle
The current bundle. |
static java.lang.String |
JS_OBJECTNAME
Name of the javascript object used to make the messages public to the javascripts. |
protected java.util.Locale |
locale
The current locale. |
protected org.slf4j.Logger |
log
|
Constructor Summary | |
---|---|
protected |
AbstractMessagesImpl(java.lang.String basename,
java.util.Locale locale)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object arg0)
True if the basename and the locale are the same. |
java.lang.String |
get(java.lang.String key,
java.lang.Object[] args)
Replace the {n} parameters in the string. |
java.lang.String |
getBasename()
If no basename is provided this method returns DEFAULT_BASENAME. |
java.util.Locale |
getLocale()
Returns the current locale. |
java.lang.String |
getWithDefault(java.lang.String key,
java.lang.Object[] args,
java.lang.String defaultMsg)
With default value and replacement strings. |
java.lang.String |
getWithDefault(java.lang.String key,
java.lang.String defaultMsg)
You can provide a default value if the key is not found. |
java.lang.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 java.lang.String JS_OBJECTNAME
protected java.lang.String basename
protected java.util.Locale locale
protected java.util.ResourceBundle bundle
Constructor Detail |
---|
protected AbstractMessagesImpl(java.lang.String basename, java.util.Locale locale)
Method Detail |
---|
public java.util.Locale getLocale()
getLocale
in interface Messages
public java.lang.String getBasename()
getBasename
in interface Messages
public java.lang.String get(java.lang.String key, java.lang.Object[] args)
get
in interface Messages
MessageFormat.format(String, Object[])
public java.lang.String getWithDefault(java.lang.String key, java.lang.String defaultMsg)
getWithDefault
in interface Messages
key
- keydefaultMsg
- the default message
public java.lang.String getWithDefault(java.lang.String key, java.lang.Object[] args, java.lang.String defaultMsg)
getWithDefault
in interface Messages
key
- keyargs
- replacement stringsdefaultMsg
- default message
public boolean equals(java.lang.Object arg0)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |