com.zphinx.spine.exceptions
Class SpineMessageException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.zphinx.spine.exceptions.SpineException
              extended by com.zphinx.spine.exceptions.SpineMessageException
All Implemented Interfaces:
Serializable

public class SpineMessageException
extends SpineException

SpineMessageException is the base spine exception that is used by this framework to create exceptions which accept locale sensitive message keys which allow parametric replacement of strings.

This exception requires (for speed purposes) that an exceptionMessageClass property be declared in the spine-init.xml file. This property is a property of the MessagePlugin and associates this exception with a properties file, which should contain your error messages.

The exception will still find you message by it's defined key if it is not in the default exceptionMessageClass, but it does this by seacrhing through all the properties files, and Locales in the application.

Version:
$1.0

Copyright ©Zphinx Software Solutions

Author:
David Ladapo
See Also:
Serialized Form

Constructor Summary
SpineMessageException(String message)
          Creates a SpineMessageException with a message key
SpineMessageException(String message, Locale locale)
          Creates a SpineMessageException with a message key at the specified locale
SpineMessageException(String message, Object[] arguments)
          Creates a SpineMessageException with a message key with the associated parametric replacements
SpineMessageException(String message, Object[] arguments, Locale locale)
          Creates a SpineMessageException with a message key with the associated parametric replacements at the specified locale
 
Method Summary
 String getLocalizedMessage()
          Gets the locale sensitive message
 String getLocalizedMessage(Locale locale)
          Gets the locale sensitive message
 String getMessage()
          Gets the message for this exception from the associated properties files
 String getMessage(Locale locale)
          Gets the message for this exception from the associated properties files
 
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

SpineMessageException

public SpineMessageException(String message)
Creates a SpineMessageException with a message key

Parameters:
message - The message key used to initialise this exception

SpineMessageException

public SpineMessageException(String message,
                             Locale locale)
Creates a SpineMessageException with a message key at the specified locale

Parameters:
message - The message key used to initialise this exception
locale - The locale within which this message key's property should be displayed

SpineMessageException

public SpineMessageException(String message,
                             Object[] arguments)
Creates a SpineMessageException with a message key with the associated parametric replacements

Parameters:
message - The message key used to initialise this exception
arguments - The parametric replacement objects used to obtain messages from the specified properties file

SpineMessageException

public SpineMessageException(String message,
                             Object[] arguments,
                             Locale locale)
Creates a SpineMessageException with a message key with the associated parametric replacements at the specified locale

Parameters:
message - The message key used to initialise this exception
arguments - The parametric replacement objects used to obtain messages from the specified properties file
locale - The locale within which this message key's property should be displayed
Method Detail

getMessage

public String getMessage()
Gets the message for this exception from the associated properties files

Overrides:
getMessage in class Throwable
Returns:
the message to get for this exception

getLocalizedMessage

public String getLocalizedMessage()
Gets the locale sensitive message

Overrides:
getLocalizedMessage in class Throwable
Returns:
the message the locale sensitive message

getMessage

public String getMessage(Locale locale)
Gets the message for this exception from the associated properties files

Parameters:
locale - The locale for which to retrieve this message
Returns:
the message to get for this exception

getLocalizedMessage

public String getLocalizedMessage(Locale locale)
Gets the locale sensitive message

Parameters:
locale - The locale for which to retrieve this message
Returns:
the message the locale sensitive message