- All Known Implementing Classes:
public interface LocalizedException
An exception which can produce an error message in the client locale. Exceptions implementing this interface apply the following policy:
getMessage()returns the message in the default locale. In a client-server architecture, this is often the locale on the server side.
getLocalizedMessage()returns the message in a locale that depends on the context in which the exception has been thrown. This is often the locale used by a
DataStoreinstance, and can be presumed to be the locale on the client side.
getInternationalMessage()may return the message in arbitrary locale (optional operation). This method is specific to Apache SIS.
Example: if an error occurred while a Japanese client connected to an European server, the localized message may be sent to the client in Japanese language while the same error may be logged on the server side in the French language. This allows system administrator to analyze the issue without the need to understand client's language.The above policy is applied on a best-effort basis only. For example exceptions that do not implement
LocalizedExceptionmay use any locale (not necessarily the default one), and
LocalizedExceptionused as wrappers around other exception usually lost their localization capability.
- See Also:
Defined in the
Method SummaryModifier and TypeMethodDescriptionIf this exception is capable to return the message in various locales, returns that message.Returns the message in the locale that depends on the context in which this exception has been thrown.Returns the message in the default locale.
getMessageString getMessage()Returns the message in the default locale. In a client-server architecture, this is usually the locale on the server side. This is the recommended language for logging messages to be read by system administrators.
- the exception message in the JVM default locale.
getLocalizedMessageString getLocalizedMessage()Returns the message in the locale that depends on the context in which this exception has been thrown. For example it may be the local of a client application connected to a distant server. This is the recommended language to show in widgets.
- the exception message in the locale of a service configured for a particular client.
getInternationalMessageInternationalString getInternationalMessage()If this exception is capable to return the message in various locales, returns that message. Otherwise returns
- the exception message, or
nullif this exception can not produce international message.