mazz.i18n.exception
Class LocalizedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by mazz.i18n.exception.LocalizedException
All Implemented Interfaces:
java.io.Serializable

public class LocalizedException
extends java.lang.Exception

A generic exception that provides localized messages.

Version:
$Revision: 1.1 $
Author:
John Mazzitelli
See Also:
Msg, Serialized Form

Constructor Summary
LocalizedException()
          Constructor for LocalizedException.
LocalizedException(java.util.Locale locale, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(Msg.BundleBaseName bundle, java.util.Locale locale, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(Msg.BundleBaseName bundle, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(Msg msg)
          Constructor for LocalizedException that explicitly takes the localized message.
LocalizedException(java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(java.lang.Throwable cause)
          Constructor for LocalizedException.
LocalizedException(java.lang.Throwable cause, java.util.Locale locale, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(java.lang.Throwable cause, Msg.BundleBaseName bundle, java.util.Locale locale, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(java.lang.Throwable cause, Msg.BundleBaseName bundle, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
LocalizedException(java.lang.Throwable cause, Msg msg)
          Constructor for LocalizedException that explicitly takes the localized message.
LocalizedException(java.lang.Throwable cause, java.lang.String key, java.lang.Object... varargs)
          Constructor for LocalizedException.
 
Method Summary
 java.lang.String getLocalizedMessage()
          This will return the localized message if one exists, otherwise, delegates to the superclass's getMessage().
 java.lang.String getMessage()
          This will return the localized message if one exists, otherwise, delegates to the superclass.
 java.lang.String getStackTraceString()
          Convenience method that returns the stack trace as a String.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalizedException

public LocalizedException()
Constructor for LocalizedException.


LocalizedException

public LocalizedException(java.lang.Throwable cause)
Constructor for LocalizedException.

Parameters:
cause -

LocalizedException

public LocalizedException(Msg.BundleBaseName bundle,
                          java.util.Locale locale,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
bundle - the basename of the resource bundle where the localized message can be found
locale - the locale used to determine the specified resource bundle to use
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(java.util.Locale locale,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
locale - the locale used to determine the specified resource bundle to use
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(Msg.BundleBaseName bundle,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
bundle - the basename of the resource bundle where the localized message can be found
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(Msg msg)
Constructor for LocalizedException that explicitly takes the localized message.

Parameters:
msg - the localized message

LocalizedException

public LocalizedException(java.lang.Throwable cause,
                          Msg.BundleBaseName bundle,
                          java.util.Locale locale,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
cause -
bundle - the basename of the resource bundle where the localized message can be found
locale - the locale used to determine the specified resource bundle to use
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(java.lang.Throwable cause,
                          java.util.Locale locale,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
cause -
locale - the locale used to determine the specified resource bundle to use
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(java.lang.Throwable cause,
                          Msg.BundleBaseName bundle,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
cause -
bundle - the basename of the resource bundle where the localized message can be found
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(java.lang.Throwable cause,
                          java.lang.String key,
                          java.lang.Object... varargs)
Constructor for LocalizedException.

Parameters:
cause -
key - the key into the resource bundle to identify the specific message to get
varargs - optional arguments to help fill in the localized message

LocalizedException

public LocalizedException(java.lang.Throwable cause,
                          Msg msg)
Constructor for LocalizedException that explicitly takes the localized message.

Parameters:
cause -
msg - the localized message
Method Detail

getMessage

public java.lang.String getMessage()
This will return the localized message if one exists, otherwise, delegates to the superclass.

Overrides:
getMessage in class java.lang.Throwable
See Also:
Throwable.getMessage()

getLocalizedMessage

public java.lang.String getLocalizedMessage()
This will return the localized message if one exists, otherwise, delegates to the superclass's getMessage().

Overrides:
getLocalizedMessage in class java.lang.Throwable
See Also:
Throwable.getLocalizedMessage()

getStackTraceString

public java.lang.String getStackTraceString()
Convenience method that returns the stack trace as a String.

Returns:
stack trace


Copyright © 2006 John J. Mazzitelli All Rights Reserved. Licensed under LGPL