|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--multex.MsgText
Services for getting the message text for exceptions. It handles exceptions
Exc
)
Failure
)
Msg
or Awt
.
MulTEx 5: Parameter i_lineSeparator removed in all methods.
Always uses the platform default.
See the discussion in the description of class Msg
.
Field Summary | |
static java.lang.String |
causeMarker
The String used by default to introduce the message of an exception, which was causing the exception justly reported. |
static java.lang.String |
causeMarkerKey
The key used to get the cause marker from a ResourceBundle. |
static java.lang.String |
resourceBundleName
The name of the ResourceBundle used on static default internationalization. |
Method Summary | |
protected static void |
appendMessageChain(java.lang.StringBuffer io_destination,
java.lang.Throwable i_throwable,
java.util.ResourceBundle i_resourceBundle)
Appends the message for i_throwable along with its causal chain. |
static void |
appendMessageLine(java.lang.StringBuffer io_destination,
java.lang.Throwable i_throwable)
Appends the usually one-line message text for the exception i_throwable with inserted parameters to io_buffer. |
static java.lang.String |
appendMessageLine(java.lang.StringBuffer io_destination,
java.lang.Throwable i_throwable,
java.util.ResourceBundle i_resourceBundle)
Appends the usually one-line message text for the exception i_throwable with inserted parameters to io_buffer, localizable. |
static java.util.ResourceBundle |
getResourceBundle()
Returns the actual ResourceBundle used for static internationalization or null, if no one is provided. |
static void |
setInternationalization(boolean i_internationalization)
If true, activates the static default internationalization of message texts. |
static void |
setInternationalization(java.util.ResourceBundle i_resourceBundle)
Activates a specific static internationalization of message texts. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String resourceBundleName
setInternationalization(boolean)
,
Constant Field Valuespublic static final java.lang.String causeMarker
causeMarkerKey
.
public static final java.lang.String causeMarkerKey
causeMarker
,
In the .properties file for a localization you should define it e.g.:
multex.MsgText.causeMarker = Cause:
Method Detail |
public static void setInternationalization(boolean i_internationalization)
appendMessageLine(java.lang.StringBuffer, java.lang.Throwable)
or appendMessageChain(java.lang.StringBuffer, java.lang.Throwable, java.util.ResourceBundle)
will deliver the
localized message text for an exception instead of the default message
text contained in the MultexException-object.
The localized message text will be taken from the resource bundle
with the name resourceBundleName
.
If false, deactivates static internationalization. The Message text for a
MultexException will be taken directly from the exception object itself.
public static void setInternationalization(java.util.ResourceBundle i_resourceBundle) throws java.lang.IllegalArgumentException
appendMessageLine(java.lang.StringBuffer, java.lang.Throwable)
or appendMessageChain(java.lang.StringBuffer, java.lang.Throwable, java.util.ResourceBundle)
will deliver the
localized message text for an exception instead of the default message
text contained in the MultexException-object.
i_resourceBundle
- How to localize exception message texts
java.lang.IllegalArgumentException
- If null is provided as i_localesetInternationalization(boolean)
public static java.util.ResourceBundle getResourceBundle()
protected static void appendMessageChain(java.lang.StringBuffer io_destination, java.lang.Throwable i_throwable, java.util.ResourceBundle i_resourceBundle)
Msg.printMessages(StringBuffer,Throwable,ResourceBundle)
instead.
public static void appendMessageLine(java.lang.StringBuffer io_destination, java.lang.Throwable i_throwable)
This file must contain definition lines of the form:
packageName.ExceptionName = message text patternor
packageName.ClassName$InnerExceptionName = message text patternwith parameter substitutors in the message text pattern, e.g.:
CopyNP$CopyFailure = The file "{0}" could not be copied to "{1}"
public static java.lang.String appendMessageLine(java.lang.StringBuffer io_destination, java.lang.Throwable i_throwable, java.util.ResourceBundle i_resourceBundle)
The message line format is produced according to the following case list:
i_resourceBundle
- Source for the message text pattern for reporting i_throwable.
The text pattern is taken with the class name of i_throwable
as key from i_resourceBundle.
Controls the formatting of the message parameters, too, by containing a Locale.
If null, falls back to no internationalization.
for details of parameter substitution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |