@Status(stage=PRODUCTION, unitTests=PARTIAL) @ThreadSafety(level=IMMUTABLE) @Review(by="Kees Schotanus", at="2009-09-28") public abstract class AbstractLocalizedException extends Exception implements Localizable
AbstractLocalizedRuntimeException
except that this class extends Exception.Constructor and Description |
---|
AbstractLocalizedException()
Default constructor that creates an empty exception (that is an exception without a message and without a cause).
|
AbstractLocalizedException(String message)
Constructs an exception using the supplied message.
|
AbstractLocalizedException(String resourceBundleName,
String messageKey,
Object... messageArguments)
Constructs a localized exception from the supplied
ResourceBundle name and the supplied message key and
optional arguments. |
AbstractLocalizedException(Throwable cause,
String message)
Constructs an exception using the supplied cause and message.
|
AbstractLocalizedException(Throwable cause,
String resourceBundleName,
String messageKey,
Object... messageArguments)
Constructs a localized exception from the supplied
ResourceBundle name, the supplied message key, optional
arguments and optional cause. |
Modifier and Type | Method and Description |
---|---|
String |
getDescription(Locale locale)
Gets the (localized) message for the supplied locale.
|
String |
getMessage()
Gets the (localized) message for the default locale.
|
String |
getMessage(Locale locale)
Gets the (localized) message for the supplied locale.
|
Object[] |
getMessageArguments()
Gets a copy of the message arguments.
|
String |
getMessageKey()
Gets the key to the resource bundle to retrieve a localized message.
|
String |
getResourceBundleName()
Gets the resource bundle name containing the localized messages.
|
String |
toString()
Converts this exception to a String.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public AbstractLocalizedException()
public AbstractLocalizedException(String message)
message
- Message indicating why the exception occurred.public AbstractLocalizedException(Throwable cause, String message)
cause
- Exception that caused this exception.
message
- Message indicating why the exception occurred.public AbstractLocalizedException(String resourceBundleName, String messageKey, Object... messageArguments)
ResourceBundle
name and the supplied message key and
optional arguments.
resourceBundleName
- The name of the
ResourceBundle
that contains the localized messages.messageKey
- Key to the resource bundle to retrieve the localized
message.messageArguments
- The optional message arguments that will be
inserted into the localized message.IllegalArgumentException
- When the supplied resourceBundleName or
messageKey is empty.NullPointerException
- When the supplied resourceBundleName or
messageKey is null.public AbstractLocalizedException(Throwable cause, String resourceBundleName, String messageKey, Object... messageArguments)
ResourceBundle
name, the supplied message key, optional
arguments and optional cause.
cause
- Exception that caused this exception.
resourceBundleName
- The name of the
ResourceBundle
that contains the localized messages.messageKey
- Key to the resource bundle to retrieve the localized
message.messageArguments
- The message arguments that will be inserted into
the localized message.IllegalArgumentException
- When the supplied resourceBundleName or
messageKey is empty.NullPointerException
- When the supplied resourceBundleName or
messageKey is null.public String getResourceBundleName()
public String getMessageKey()
public Object[] getMessageArguments()
public String getMessage()
getMessage
in class Throwable
public String getMessage(Locale locale)
locale
- The locale.
MissingResourceException
.public String getDescription(Locale locale)
getMessage(Locale)
but is needed to implement Localizable
.getDescription
in interface Localizable
locale
- The locale.
getMessage(Locale)
Copyright © 2008–2018. All rights reserved.