- All Known Implementing Classes:
public interface LocalizedExceptionAn exception which can produce an error message in the client locale. Exceptions implementing this interface apply the following policy:
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
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.
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
getInternationalMessage()If this exception is capable to return the message in various locales, returns that message.
getLocalizedMessage()Returns the message in the locale that depends on the context in which this exception has been thrown.
getMessage()Returns the message in the default locale.
String 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.
String 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.
InternationalString 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.