I18N Msg
objects are serializable and will be re-translated once it is deserialized. This means that a message could be localized in the English language, serialized and sent over the wire to another JVM with a German locale and when the deserialized message is retrieved again, it will be in German. This feature assumes a resource bundle with the same base bundle name exists in the JVM that deserialized the Msg
. If it does not, then the original message will be used (in the previous example, it would mean the English message would be retrieved in the JVM, even though its locale is German).
There is a method to the madness to some of the methods' parameter ordering. Anytime you want to specify a localized message, you always specify the base bundle name first, followed by the locale, the bundle key and the variable list of arguments that go with the keyed message (all in that order). Bundle name and locale are both optional. This is consistent with the way localized messages are specified in constructors for {@link LocalizedException} and {@link LocalizedRuntimeException}. When you need to specify a Throwable
with your localized message, it is specified before those parameters. Again, this is consistent both in this class and the localized exception classes (see {@link #createMsg(com.sos.i18n.Msg.BundleBaseName,Locale,String,Object[])} and{@link LocalizedException#LocalizedException(Throwable,com.sos.i18n.Msg.BundleBaseName,Locale,String,Object[])}as examples).
I18N Msg
objects are serializable and will be re-translated once it is deserialized. This means that a message could be localized in the English language, serialized and sent over the wire to another JVM with a German locale and when the deserialized message is retrieved again, it will be in German. This feature assumes a resource bundle with the same base bundle name exists in the JVM that deserialized the Msg
. If it does not, then the original message will be used (in the previous example, it would mean the English message would be retrieved in the JVM, even though its locale is German).
There is a method to the madness to some of the methods' parameter ordering. Anytime you want to specify a localized message, you always specify the base bundle name first, followed by the locale, the bundle key and the variable list of arguments that go with the keyed message (all in that order). Bundle name and locale are both optional. This is consistent with the way localized messages are specified in constructors for {@link LocalizedException} and {@link LocalizedRuntimeException}. When you need to specify a Throwable
with your localized message, it is specified before those parameters. Again, this is consistent both in this class and the localized exception classes (see {@link #createMsg(mazz.i18n.Msg.BundleBaseName,Locale,String,Object[])} and{@link LocalizedException#LocalizedException(Throwable,mazz.i18n.Msg.BundleBaseName,Locale,String,Object[])}as examples).
Field
and a pluggable validator instead of using the default message stored in the ValidatorAction
(aka pluggable validator). Instances of this class are configured with a <msg> xml element.
@version $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|