public class L10NMessageImpl extends Exception implements L10NMessage
L10NMessage
Interface. Extends
java.lang.Exception
an provides mechanism to provide resource
bundle for error messagesConstructor and Description |
---|
L10NMessageImpl(String msg) |
L10NMessageImpl(String rbName,
String errorCode,
Object[] args)
This constructor is used to pass the localized error message At this
level, the locale of the caller is not known and it is not possible to
throw localized error message at this level.
|
L10NMessageImpl(String message,
Throwable cause) |
L10NMessageImpl(Throwable ex)
This constructor is used to extract localized error message from
throwable.
|
Modifier and Type | Method and Description |
---|---|
String |
getErrorCode()
Returns error code associated with this error message.
|
String |
getL10NMessage(Locale locale)
Returns localized error message.
|
String |
getMessage()
Returns message of the exception.
|
Object[] |
getMessageArgs()
Returns arguments for formatting this error message.
|
String |
getResourceBundleName()
Returns resource bundle name associated with this error message.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public L10NMessageImpl(String msg)
public L10NMessageImpl(String rbName, String errorCode, Object[] args)
rbName
- ResourceBundle Name to be used for getting localized error
message.errorCode
- Key to resource bundle. You can use
ResourceBundle rb = ResourceBunde.getBundle(rbName, locale); String localizedStr = rb.getString(errorCode);
args
- Arguments to message. If it is not present pass the as null.public L10NMessageImpl(Throwable ex)
ex
- if the exception message is instance of L10NMessage, the
bundleName,errorCode and args are extracted from throwablepublic String getL10NMessage(Locale locale)
getL10NMessage
in interface L10NMessage
locale
- Locale of the error message.L10NMessageImpl(String, String, Object[])
public String getResourceBundleName()
getResourceBundleName
in interface L10NMessage
L10NMessageImpl(String, String, Object[])
public String getErrorCode()
getErrorCode
in interface L10NMessage
L10NMessageImpl(String, String, Object[])
public Object[] getMessageArgs()
MessageFormat
class to format the message It can be null.getMessageArgs
in interface L10NMessage
L10NMessageImpl(String, String, Object[])
public String getMessage()
getMessage
in interface L10NMessage
getMessage
in class Throwable
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.