com.flexive.shared.exceptions
Class FxExceptionMessage

java.lang.Object
  extended by com.flexive.shared.exceptions.FxExceptionMessage
All Implemented Interfaces:
java.io.Serializable

public class FxExceptionMessage
extends java.lang.Object
implements java.io.Serializable

Localized Exception message handling

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Constructor Summary
FxExceptionMessage(java.lang.String key, java.lang.Object... values)
          Ctor
 
Method Summary
static void cleanup()
          Cleanup cached resources.
 boolean equals(java.lang.Object obj)
          
 java.lang.Object[] getArguments()
          Getter for the message values (arguments)
 java.lang.String getKey()
          Getter for the key
 java.lang.String getLocalizedMessage(FxLanguage language)
          Get the localized message for a given language code
 java.lang.String getResource(java.lang.String key)
          Returns the resource bundle in the default locale.
 java.lang.String getResource(java.lang.String key, java.util.Locale locale)
          Returns the resource bundle, which is cached within the request.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxExceptionMessage

public FxExceptionMessage(java.lang.String key,
                          java.lang.Object... values)
Ctor

Parameters:
key - resource key
values - optional values for placeholders in key ({x})
Method Detail

getResource

public java.lang.String getResource(java.lang.String key)
Returns the resource bundle in the default locale.

Parameters:
key - resource key
Returns:
the resource bundle value

getResource

public java.lang.String getResource(java.lang.String key,
                                    java.util.Locale locale)
Returns the resource bundle, which is cached within the request.

Parameters:
key - resource key
locale - the requested locale
Returns:
the resource bundle value

getKey

public java.lang.String getKey()
Getter for the key

Returns:
key resource key

getArguments

public java.lang.Object[] getArguments()
Getter for the message values (arguments)

Returns:
message key arguments
Since:
3.2.0

getLocalizedMessage

public java.lang.String getLocalizedMessage(FxLanguage language)
Get the localized message for a given language code

Parameters:
language - the language
Returns:
localized message

cleanup

public static void cleanup()
Cleanup cached resources.

Since:
3.1.4

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object