com.ibm.gcs.component
Class NLSException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--com.ibm.gcs.component.NLSException
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ConfigException, IllegalProtocolException, TransactionException
- public class NLSException
- extends java.lang.Exception
This is the base class for all Exception
s in GCS,
and provides NLS support for exception messages.
It looks up the Exception message using the provideded message key, optional parameters,
and the com.ibm.gcs.nls.GCSBundle
resource bundle (with the current Locale).
- See Also:
- Serialized Form
Constructor Summary |
NLSException()
creates a Exception with no message (BAD!) |
NLSException(java.lang.String messageKey)
creates a RuntimeException with an NLS message |
NLSException(java.lang.String messageKey,
java.lang.Object[] parameters)
creates a RuntimeException with an NLS message with parameters |
Method Summary |
static java.lang.String |
localize(java.lang.String messageKey)
finds the localized version of a message key |
static java.lang.String |
localize(java.lang.String messageKey,
java.lang.Object[] parameters)
finds the localized version of a message key with parameters |
static void |
setLocale(java.util.Locale locale)
sets the Locale for the NLS messages used by these exceptions |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NLSException
public NLSException()
- creates a
Exception
with no message (BAD!)
NLSException
public NLSException(java.lang.String messageKey)
- creates a
RuntimeException
with an NLS message
NLSException
public NLSException(java.lang.String messageKey,
java.lang.Object[] parameters)
- creates a
RuntimeException
with an NLS message with parameters
localize
public static java.lang.String localize(java.lang.String messageKey)
- finds the localized version of a message key
localize
public static java.lang.String localize(java.lang.String messageKey,
java.lang.Object[] parameters)
- finds the localized version of a message key with parameters
setLocale
public static void setLocale(java.util.Locale locale)
- sets the Locale for the NLS messages used by these exceptions
(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.