org.loom.exception
Class LocaleAwareException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.loom.exception.LocaleAwareException
All Implemented Interfaces:
java.io.Serializable, LocaleAwareThrowable
Direct Known Subclasses:
BusinessException, MissingRequiredPropertyException

public class LocaleAwareException
extends java.lang.RuntimeException
implements LocaleAwareThrowable

Locale-dependent exceptions. This may be handled as validation errors if there is a source form.

See Also:
Serialized Form

Constructor Summary
LocaleAwareException(Message message)
          This constructor receives the i18n message to display to the user.
LocaleAwareException(java.lang.String messageKey)
          Note that this constructor will display a meaningless message (the message key and params) if there is no
LocaleAwareException(java.lang.String message, java.lang.String messageKey)
          Deprecated. use LocaleAwareException(String) instead
LocaleAwareException(java.lang.String message, java.lang.String messageKey, java.lang.Throwable cause)
          Deprecated. use LocaleAwareException(String, Throwable) instead
LocaleAwareException(java.lang.String messageKey, java.lang.Throwable cause)
          Note that this constructor will display a meaningless message (the message key and params) if there is no
 
Method Summary
 LocaleAwareException addArg(java.lang.String arg, java.lang.Object value)
           
 LocaleAwareException addTranslatedArg(java.lang.String arg, java.lang.Object value)
           
 java.util.Map<java.lang.String,java.lang.Object> getArgs()
           
 Message getLocaleAwareMessage()
           
 java.lang.String getMessage()
           
 java.lang.String getMessageKey()
           
 java.util.Map<java.lang.String,java.lang.Object> getTranslatedArgs()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

LocaleAwareException

public LocaleAwareException(java.lang.String message,
                            java.lang.String messageKey,
                            java.lang.Throwable cause)
Deprecated. use LocaleAwareException(String, Throwable) instead

Parameters:
message - the message to be printed in logs and where the current locale cannot be resolved
messageKey - the key of the message to be looked for in the current MessagesRepository instance
cause - the cause of this exception

LocaleAwareException

public LocaleAwareException(java.lang.String message,
                            java.lang.String messageKey)
Deprecated. use LocaleAwareException(String) instead

Parameters:
message - the message to be printed in logs and where the current locale cannot be resolved
messageKey - the key of the message to be looked for in the current MessagesRepository instance

LocaleAwareException

public LocaleAwareException(java.lang.String messageKey)
Note that this constructor will display a meaningless message (the message key and params) if there is no

Parameters:
messageKey - the key of the message to be looked for in the current MessagesRepository instance

LocaleAwareException

public LocaleAwareException(java.lang.String messageKey,
                            java.lang.Throwable cause)
Note that this constructor will display a meaningless message (the message key and params) if there is no

Parameters:
messageKey - the key of the message to be looked for in the current MessagesRepository instance
cause - the cause of this exception

LocaleAwareException

public LocaleAwareException(Message message)
This constructor receives the i18n message to display to the user. Note that this constructor will display a meaningless message (the message key and params) if there is no MessagesRepository instance available.

Parameters:
message - the message to be printed in logs and where the current locale cannot be resolved
Method Detail

getLocaleAwareMessage

public Message getLocaleAwareMessage()
Specified by:
getLocaleAwareMessage in interface LocaleAwareThrowable
Returns:
the message key that will be looked for ion the current MessagesRepository

addArg

public LocaleAwareException addArg(java.lang.String arg,
                                   java.lang.Object value)

addTranslatedArg

public LocaleAwareException addTranslatedArg(java.lang.String arg,
                                             java.lang.Object value)

getArgs

public java.util.Map<java.lang.String,java.lang.Object> getArgs()

getMessageKey

public java.lang.String getMessageKey()

getTranslatedArgs

public java.util.Map<java.lang.String,java.lang.Object> getTranslatedArgs()

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable