@Status(stage=PRODUCTION, unitTests=PARTIAL) @ThreadSafety(level=IMMUTABLE) @Review(by="Kees Schotanus", at="2009-09-28") public abstract class AbstractLocalizedRuntimeException extends RuntimeException implements Localizable
AbstractLocalizedException
except that this class extends RuntimeException.| Constructor and Description |
|---|
AbstractLocalizedRuntimeException()
Default constructor that creates an empty exception (that is an exception
without a message and without a cause).
|
AbstractLocalizedRuntimeException(String message)
Constructs an exception using the supplied message.
|
AbstractLocalizedRuntimeException(String resourceBundleName,
String messageKey,
Object... messageArguments)
Constructs a localized exception from the supplied
ResourceBundle name and the supplied message key and
optional arguments. |
AbstractLocalizedRuntimeException(Throwable cause,
String message)
Constructs an exception using the supplied cause and message.
|
AbstractLocalizedRuntimeException(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, setStackTracepublic AbstractLocalizedRuntimeException()
public AbstractLocalizedRuntimeException(String message)
message - Message indicating why the exception occurred.public AbstractLocalizedRuntimeException(Throwable cause, String message)
cause - Exception that caused this exception.
message - Message indicating why the exception occurred.public AbstractLocalizedRuntimeException(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 AbstractLocalizedRuntimeException(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 Throwablepublic String getMessage(Locale locale)
locale - The locale.
MissingResourceException.public String getDescription(Locale locale)
getMessage(Locale) but is needed to implement Localizable.getDescription in interface Localizablelocale - The locale.
getMessage(Locale)Copyright © 2008–2017. All rights reserved.