Package com.sun.identity.common
Class L10NMessageImpl
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.sun.identity.common.L10NMessageImpl
-
- All Implemented Interfaces:
L10NMessage,Serializable
public class L10NMessageImpl extends Exception implements L10NMessage
Deprecated.As of OpenSSO version 8.0L10NMessageImplConvenient implementation of L10NMessage Interface. Extends java.lang.Exception an provides mechanism to provide resource bundle for error messages- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description L10NMessageImpl(String msg)Deprecated.L10NMessageImpl(String rbName, String errorCode, Object[] args)Deprecated.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(Throwable ex)Deprecated.This constructor is used to extract localized error message from throwable
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetErrorCode()Deprecated.Returns error code associated with this error message.StringgetL10NMessage(Locale locale)Deprecated.Returns localized error message.StringgetMessage()Deprecated.Use this method to get error message in default ENGLISH locale.Object[]getMessageArgs()Deprecated.Returns arguments for formatting this error message.StringgetResourceBundleName()Deprecated.Returns resource bundle name associated with this error message.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
L10NMessageImpl
public L10NMessageImpl(String msg)
Deprecated.
-
L10NMessageImpl
public L10NMessageImpl(String rbName, String errorCode, Object[] args)
Deprecated.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. Instead this constructor provides Resource Bundle name and errorCode for correctly locating the error messsage. The default getMessage() will always return English messages only. This is in consistent with current JRE- Parameters:
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
-
L10NMessageImpl
public L10NMessageImpl(Throwable ex)
Deprecated.This constructor is used to extract localized error message from throwable- Parameters:
ex- if the exception message is instance of L10NMessage, the bundleName,errorCode and args are extracted from throwable
-
-
Method Detail
-
getL10NMessage
public String getL10NMessage(Locale locale)
Deprecated.Returns localized error message.- Specified by:
getL10NMessagein interfaceL10NMessage- Parameters:
locale-- Returns:
- localized error message.
- See Also:
L10NMessageImpl(String, String, Object[])
-
getResourceBundleName
public String getResourceBundleName()
Deprecated.Returns resource bundle name associated with this error message.- Specified by:
getResourceBundleNamein interfaceL10NMessage- Returns:
- resource bundle name associated with this error message.
- See Also:
L10NMessageImpl(String, String, Object[])
-
getErrorCode
public String getErrorCode()
Deprecated.Returns error code associated with this error message.- Specified by:
getErrorCodein interfaceL10NMessage- Returns:
- error code associated with this error message.
- See Also:
L10NMessageImpl(String, String, Object[])
-
getMessageArgs
public Object[] getMessageArgs()
Deprecated.Returns arguments for formatting this error message. You need to use MessageFormat class to format the message It can be null.- Specified by:
getMessageArgsin interfaceL10NMessage- Returns:
- arguments for formatting this error message.
- See Also:
L10NMessageImpl(String, String, Object[])
-
getMessage
public String getMessage()
Deprecated.Description copied from interface:L10NMessageUse this method to get error message in default ENGLISH locale.- Specified by:
getMessagein interfaceL10NMessage- Overrides:
getMessagein classThrowable- Returns:
- gets error message
-
-