flex.messaging
Class LocalizedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by flex.messaging.LocalizedException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MessageException

public class LocalizedException
extends RuntimeException

The LocalizedException class is the base class for server exceptions that use localized error message and details strings. This class overloads setMessage and setDetails to support passing an error number and an optional message variant that is used to look up a localized error message or details string using a ResourceLoader. These methods also set the number property of the exception instance.

The various overloads optionally support specifying a target locale as well as arguments to substitute into the localized string if it is parameterized.

Localized error message and details strings are stored in the flex.messaging.errors resource bundle. Entries must have the following format.

See Also:
ResourceLoader, Serialized Form

Constructor Summary
LocalizedException()
          Create a LocalizedException with the default ResourceLoader.
LocalizedException(flex.messaging.util.ResourceLoader resourceLoader)
          Create a LocalizedException that will use the specified ResourceLoader.
 
Method Summary
 String getDetails()
          Returns the exception details.
 String getMessage()
          Returns the exception message.
 int getNumber()
          Returns the localized exception number.
 Throwable getRootCause()
          Returns the root cause for this exception.
 void setDetails(int number)
          Sets the details property to a localized string based on error number.
 void setDetails(int number, String variant)
          Sets the details property to a localized string based on error number and variant.
 void setDetails(int number, String variant, Locale locale)
          Sets the details property to a localized string based on error number, variant and target locale.
 void setDetails(int number, String variant, Locale locale, Object[] arguments)
          Sets the details property to a localized string based on error number, variant, and target locale.
 void setDetails(int number, String variant, Object[] arguments)
          Sets the details property to a localized string based on error number and variant.
 void setDetails(String details)
          Sets the exception details.
 void setMessage(int number)
          Sets the message property to a localized string based on error number.
 void setMessage(int number, Locale locale)
          Sets the message property to a localized string based on error number and target locale.
 void setMessage(int number, Object[] arguments)
          Sets the message property to a localized string based on error number.
 void setMessage(int number, String variant)
          Sets the message property to a localized string based on error number and variant.
 void setMessage(int number, String variant, Locale locale)
          Sets the message property to a localized string based on error number, variant and target locale.
 void setMessage(int number, String variant, Locale locale, Object[] arguments)
          Sets the message property to a localized string based on error number, variant and target locale.
 void setMessage(int number, String variant, Object[] arguments)
          Sets the message property to a localized string based on error number and variant.
 void setMessage(String message)
          Sets the exception message.
 void setNumber(int number)
          Sets the localized exception number.
 void setRootCause(Throwable cause)
          Sets the root cause for this exception.
 String toString()
          Returns a string represenation of the exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalizedException

public LocalizedException()
Create a LocalizedException with the default ResourceLoader.


LocalizedException

public LocalizedException(flex.messaging.util.ResourceLoader resourceLoader)
Create a LocalizedException that will use the specified ResourceLoader.

Parameters:
resourceLoader -
Method Detail

getDetails

public String getDetails()
Returns the exception details.

Returns:
The exception details.

setDetails

public void setDetails(String details)
Sets the exception details.

Parameters:
details - The exception details.

setMessage

public void setMessage(int number)
Sets the message property to a localized string based on error number.

Parameters:
number - The error number for this exception instance.

setMessage

public void setMessage(int number,
                       Locale locale)
Sets the message property to a localized string based on error number and target locale.

Parameters:
number - The error number for this exception instance.
locale - The target locale for error message lookup.

setMessage

public void setMessage(int number,
                       Object[] arguments)
Sets the message property to a localized string based on error number. The passed arguments are substituted into the parameterized error message string.

Parameters:
number - The error number for this exception instance.
arguments - The arguments to substitute into the error message.

setMessage

public void setMessage(int number,
                       String variant)
Sets the message property to a localized string based on error number and variant.

Parameters:
number - The error number for this exception instance.
variant - The variant of the error message for this instance.

setMessage

public void setMessage(int number,
                       String variant,
                       Locale locale)
Sets the message property to a localized string based on error number, variant and target locale.

Parameters:
number - The error number for this exception instance.
variant - The variant of the error message for this instance.
locale - The target locale for error message lookup.

setMessage

public void setMessage(int number,
                       String variant,
                       Object[] arguments)
Sets the message property to a localized string based on error number and variant. The passed arguments are substituted into the parameterized error message string.

Parameters:
number - The error number for this exception instance.
variant - The varient of the error message for this instance.
arguments - The arguments to substitute into the error message.

setMessage

public void setMessage(int number,
                       String variant,
                       Locale locale,
                       Object[] arguments)
Sets the message property to a localized string based on error number, variant and target locale. The passed arguments are substituted into the parameterized error message string.

Parameters:
number - The error number for this exception instance.
variant - The variant of the error message for this instance.
locale - The target locale for error message lookup.
arguments - The arguments to substitute into the error message.

getMessage

public String getMessage()
Returns the exception message.

Overrides:
getMessage in class Throwable
Returns:
The exception message.

setMessage

public void setMessage(String message)
Sets the exception message.

Parameters:
message - The exception message.

setNumber

public void setNumber(int number)
Sets the localized exception number.

Parameters:
number - The localized exception number.

getNumber

public int getNumber()
Returns the localized exception number.

Returns:
The localized exception number.

setDetails

public void setDetails(int number)
Sets the details property to a localized string based on error number.

Parameters:
number - The error number to lookup details for.

setDetails

public void setDetails(int number,
                       String variant)
Sets the details property to a localized string based on error number and variant.

Parameters:
number - The error number to lookup details for.
variant - The variant of the details string to lookup.

setDetails

public void setDetails(int number,
                       String variant,
                       Locale locale)
Sets the details property to a localized string based on error number, variant and target locale.

Parameters:
number - The error number to lookup details for.
variant - The variant of the details string to lookup.
locale - The target locale for the lookup.

setDetails

public void setDetails(int number,
                       String variant,
                       Object[] arguments)
Sets the details property to a localized string based on error number and variant. The passed arguments are substituted into the parameterized error details string.

Parameters:
number - The error number to lookup details for.
variant - The variant of the details string to lookup.
arguments - The arguments to substitute into the details string.

setDetails

public void setDetails(int number,
                       String variant,
                       Locale locale,
                       Object[] arguments)
Sets the details property to a localized string based on error number, variant, and target locale. The passed arguments are substituted into the parameterized error details string.

Parameters:
number - The error number to lookup a localized details string for.
variant - The variant of the details string to lookup.
locale - The target locale for the lookup.
arguments - The arguments to substitute into the details string.

getRootCause

public Throwable getRootCause()
Returns the root cause for this exception.

Returns:
The root cause for this exception.

setRootCause

public void setRootCause(Throwable cause)
Sets the root cause for this exception.

Parameters:
cause - The root cause for this exception.

toString

public String toString()
Returns a string represenation of the exception.

Overrides:
toString in class Throwable
Returns:
A string representation of the exception.


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/LocalizedException.html