|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.maven.util.report.MessageHelper
public class MessageHelper
Helps to fetch labels to render reports. Labels are taken from two resource bundles: a standard and a default one. If a key is not found in the standard bundle, it is fetched from the default bundle. If it is not found there either the key is returned verbatim.
Constructor Summary | |
---|---|
MessageHelper(String reportTitleId, String reportDescriptionId, ResourceBundle messages, ResourceBundle defaultMessages) Default constructor. |
Method Summary | |
---|---|
String |
getLabel(String key) Returns the label for the given key . |
String |
getLabel(String key, String defaultLabel) Returns the label for the given key . |
Locale |
getLocale() Returns the locale the message helper provides messages for. |
String |
getReportDescriptionId() Returns the localized report description. |
String |
getReportTitleId() Returns the localized report title. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageHelper(String reportTitleId, String reportDescriptionId, ResourceBundle messages, ResourceBundle defaultMessages) throws NullPointerException
reportTitleId
- the localized report title.
reportDescriptionId
- the localized report description.
messages
- the primary message bundle to use.
defaultMessages
- the default messages that are used if the
messages
contain no value for a given key.
NullPointerException
- if
defaultMessages
is
null
.
Method Detail |
---|
public String getReportTitleId()
public String getReportDescriptionId()
public Locale getLocale()
public String getLabel(String key)
key
.
key
- the key to the requested label.
key
or the
key
, if no label is found for that
key
.
public String getLabel(String key, String defaultLabel)
key
.
key
- the key to the requested label.
defaultLabel
- the label to return if no label is found by the
key
.
key
or the
defaultLabel
, if no label is found for that
key
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |