com.filenet.wcm.toolkit.util
Class WcmException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.filenet.wcm.toolkit.util.WcmException
All Implemented Interfaces:
java.io.Serializable

public class WcmException
extends java.lang.Exception
implements java.io.Serializable

WcmException is a utility class to facilitate globalization by retrieving a localized error message from the resource file using the given key.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object[] args
          Arguments to use when generating the final string.
protected  java.util.Locale defaultLocale
          The default locale to use.
protected  java.lang.String key
          Key for looking up a resource string in the resource file.
protected  java.lang.String returnUrl
           
static WcmString rootException
           
protected  int status
           
static int STATUS_ERROR
          Value for setStatus/getStatus.
static int STATUS_WARNING
          Value for setStatus/getStatus.
protected  java.lang.Throwable targetException
           
 
Constructor Summary
WcmException(java.util.Locale locale, java.lang.String aKey, java.lang.String engString)
          Constructor
WcmException(java.util.Locale locale, java.lang.String aKey, java.lang.String engString, java.lang.Object arg0)
          Constructor
WcmException(java.util.Locale locale, java.lang.String aKey, java.lang.String engString, java.lang.Object[] arguments)
          Constructor
WcmException(java.util.Locale locale, java.lang.String aKey, java.lang.String engString, java.lang.Object arg0, java.lang.Object arg1)
          Constructor
WcmException(java.util.Locale locale, java.lang.String aKey, java.lang.String engString, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
          Constructor
WcmException(java.lang.String aKey, java.lang.String engString)
          Constructor
WcmException(java.lang.String aKey, java.lang.String engString, java.lang.Object arg0)
          Constructor
WcmException(java.lang.String aKey, java.lang.String engString, java.lang.Object[] arguments)
          Constructor
WcmException(java.lang.String aKey, java.lang.String engString, java.lang.Object arg0, java.lang.Object arg1)
          Constructor
WcmException(java.lang.String aKey, java.lang.String engString, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
          Constructor
 
Method Summary
 java.lang.String getKey()
          Retrieve the key representing the exception.
 java.lang.String getLocalizedMessage()
          Retrieve the localized version of the exception message.
static java.lang.String getLocalizedMessage(java.util.Locale locale, java.lang.Throwable t)
           
 java.lang.String getMessage()
          Retrieve the localized version of the exception message.
 java.lang.String getReturnUrl()
          Get the return URL.
 int getStatus()
          Return the status value.
 java.lang.Throwable getTargetException()
          Return the target exception.
static void loadResource(java.io.InputStream in)
          Deprecated. This method has been replaced.
static void loadResource(java.util.Map m)
          Deprecated. This method has been replaced.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream printStream)
           
 void printStackTrace(java.io.PrintWriter printWriter)
           
 void setReturnUrl(java.lang.String value)
          Set the return URL.
 void setStatus(int value)
          Set the status value.
 void setTargetException(java.lang.Throwable value)
          Set the target exception.
 java.lang.String toString()
          Retrieve the localized version of the exception message.
 java.lang.String toString(java.util.Locale locale)
          Retrieve the localized version of the exception message.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rootException

public static final WcmString rootException

STATUS_ERROR

public static final int STATUS_ERROR
Value for setStatus/getStatus.

See Also:
Constant Field Values

STATUS_WARNING

public static final int STATUS_WARNING
Value for setStatus/getStatus.

See Also:
Constant Field Values

key

protected java.lang.String key
Key for looking up a resource string in the resource file.


args

protected java.lang.Object[] args
Arguments to use when generating the final string.


defaultLocale

protected java.util.Locale defaultLocale
The default locale to use.


status

protected int status

returnUrl

protected java.lang.String returnUrl

targetException

protected java.lang.Throwable targetException
Constructor Detail

WcmException

public WcmException(java.lang.String aKey,
                    java.lang.String engString)
Constructor

Parameters:
aKey - Key to use in looking up a resource in the reource file.
engString - English version of resource string the application uses to generate the resource file.

WcmException

public WcmException(java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object arg0)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
arg0 - First argument to apply when formatting the resource string.

WcmException

public WcmException(java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object arg0,
                    java.lang.Object arg1)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
arg0 - First argument to apply when formatting the resource string.
arg1 - Second argument to apply when formatting the resource string.

WcmException

public WcmException(java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object arg0,
                    java.lang.Object arg1,
                    java.lang.Object arg2)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
arg0 - First argument to apply when formatting the resource string.
arg1 - Second argument to apply when formatting the resource string.
arg2 - Third argument to apply when formatting the resource string.

WcmException

public WcmException(java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object[] arguments)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.

WcmException

public WcmException(java.util.Locale locale,
                    java.lang.String aKey,
                    java.lang.String engString)
Constructor

Parameters:
aKey - Key to use in looking up a resource in the reource file.
engString - English version of resource string the application uses to generate the resource file.

WcmException

public WcmException(java.util.Locale locale,
                    java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object arg0)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
arg0 - First argument to apply when formatting the resource string.

WcmException

public WcmException(java.util.Locale locale,
                    java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object arg0,
                    java.lang.Object arg1)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
arg0 - First argument to apply when formatting the resource string.
arg1 - Second argument to apply when formatting the resource string.

WcmException

public WcmException(java.util.Locale locale,
                    java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object arg0,
                    java.lang.Object arg1,
                    java.lang.Object arg2)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
arg0 - First argument to apply when formatting the resource string.
arg1 - Second argument to apply when formatting the resource string.
arg2 - Third argument to apply when formatting the resource string.

WcmException

public WcmException(java.util.Locale locale,
                    java.lang.String aKey,
                    java.lang.String engString,
                    java.lang.Object[] arguments)
Constructor

Parameters:
aKey - Key to use in looking up the specified resource string.
engString - English version of resource string the application uses to generate the resource file.
Method Detail

getLocalizedMessage

public static java.lang.String getLocalizedMessage(java.util.Locale locale,
                                                   java.lang.Throwable t)

toString

public java.lang.String toString()
Retrieve the localized version of the exception message.

Returns:
The localized message, if available; otherwise, the default message.

toString

public java.lang.String toString(java.util.Locale locale)
Retrieve the localized version of the exception message.

Returns:
The localized message, if available; otherwise, the default message.

getMessage

public java.lang.String getMessage()
Retrieve the localized version of the exception message.

Returns:
The localized message, if available; otherwise, the default message.

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Retrieve the localized version of the exception message.

Returns:
The localized message, if available; otherwise, the default message.

getKey

public java.lang.String getKey()
Retrieve the key representing the exception.

Returns:
The key. It can be used to further differentiate the exception thrown, if needed.

getStatus

public int getStatus()
Return the status value.

Returns:
The status value. Either STATUS_ERROR or STATUS_WARNING.

setStatus

public void setStatus(int value)
Set the status value.

Parameters:
value - The status value. Either STATUS_ERROR or STATUS_WARNING.

getTargetException

public java.lang.Throwable getTargetException()
Return the target exception.

Returns:
A reference to the target exception. null if undefined.

setTargetException

public void setTargetException(java.lang.Throwable value)
Set the target exception.

Parameters:
value - A reference to the target exception.

getReturnUrl

public java.lang.String getReturnUrl()
Get the return URL.

Returns:
The return URL to use on the error page. null if undefined.

setReturnUrl

public void setReturnUrl(java.lang.String value)
Set the return URL.

Parameters:
value - The return URL to use on the error page.

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(java.io.PrintStream printStream)

printStackTrace

public void printStackTrace(java.io.PrintWriter printWriter)

loadResource

public static void loadResource(java.io.InputStream in)
                         throws java.io.IOException
Deprecated. This method has been replaced.

Loads a new globalization resource bundle

Parameters:
in - InputStream object
Throws:
java.io.IOException - if any IO Errors occur

loadResource

public static void loadResource(java.util.Map m)
Deprecated. This method has been replaced.

Loads a new globalization resource bundle

Parameters:
m - Map object containing key-value pairs


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.